yii-enhancephp Enhance PHP Framework for Yii

  1. Requirements
  2. Instalation
  3. Basic usage
  4. Acknowledgement
  5. Version
  6. Resources

Requirements

Yii 1.1 or above

Instalation

Copy the extracted files in protected/extensions In protected/tests create a new file boot.php with the following content:

<?php
// file boot.php

$yiit=dirname(__FILE__).'/path/to/yii/yiit.php';
$config=dirname(__FILE__).'/../config/test.php';

require_once($yiit);

Yii::createWebApplication($config);

?>

Create in protected/tests/unit a new file exp: main.php and add this code:

<?php

require_once '/../boot.php';

Yii::import('ext.EnhancePHP.*');

// Find the tests - '.' is the current folder
EnhancePHPCore::discoverTests('.', true);
// Run the tests
EnhancePHPCore::runTests();

?>

Run Tests Create a simple test in protected/tests/unit folder exp:

class ExempleTest extends EnhancePHPTestFixture {

    public function setUp() {

    }

    public function tearDown() {

    }

    public function add1plus1(){
        $sum = 1 + 1;
        EnhancePHPAssert::areIdentical(2, $sum);
    }

}

?>

and run in CLI

cd path/to/your/application/protected/tests/unit
php -f main.php

More examples -> https://github.com/tofan-andrei/yii-EnhancePHP/tree/master/Self-Test

Basic usage

Just replace \Enhance\ with EnhancePHP exp: \Enhance\Core::runTests(); will become EnhancePHPCore::runTests();

Acknowledgement

This framework (Enhance PHP Framework) in not written by me, is written by Steve Fenton * http://www.enhance-php.com/ , i just refactored the code to work well with Yii Framework.

Version

version 1.0 - Enhance Test Framework v2.1.2

Resources

3 0
4 followers
217 downloads
Yii Version: 1.1
License: Apache-2.0
Category: Others
Developed by: Tofan Andrei
Created on: Mar 4, 2012
Last updated: 6 years ago

Downloads

show all

Related Extensions