We are going to deploy the new yiiframework.com website on March 23, 2018 from 8:00 to 12:00 UTC.
Website and Yii documentation will not be available in this time frame. Check the news for more details.

Yii 1.1: yii-enhancephp

Enhance PHP Framework for Yii


Yii 1.1 or above


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

// file boot.php

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

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

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();


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 1.0 - Enhance Test Framework v2.1.2


Total 2 comments

#7254 report it
Tofan Andrei at 2012/03/07 09:15am
Re: Brilliant plugin - but why is the English translation class partly in Romanian?!

Sorry, i forgot to change that, i will fix the class immediately.

Thanks for notice the problem.

#7251 report it
vario at 2012/03/07 05:47am
Brilliant plugin - but why is the English translation class partly in Romanian?!

Thanks for your hard work on this plugin - it works a treat! I hope you can keep it up to date as EnhancePHP is actively being improved.

But I noticed that even though the plugin is set to be in English by default, running the tests spits out what I think is Romanian. Having investigated it, the following lines of code are held inside the EnhancePHPTextEn class:

public $FormatForTestRunTook = 'Testul a durat {0} secunde';
public $FormatForExpectedButWas = 'Se astepta {0} dar a returnat {1}';
public $FormatForExpectedNotButWas = 'Nu se astepta {0} dar a returnat {1}';

These lines should be:

public $FormatForTestRunTook = 'Test run took {0} seconds';
public $FormatForExpectedButWas = 'Expected {0} but was {1}';
public $FormatForExpectedNotButWas = 'Expected NOT {0} but was {1}';

It should be really easy to create a class specifically for Romanian and then contribute it to the original project instead of overwriting the default language file. It made things a little confusing at first!

Leave a comment

Please to leave your comment.

Create extension