phpxmlunit-testingphpunitfuelphp

FuelPHP Call to undefined method PHPUnit_Util_Configuration::getTestdoxGroupConfiguration()


I am getting error on fuelphp unit test code. please suggest me how can i solve it. I am not getting any solution in fuelphp

$ phpunit --version
PHPUnit 3.7.21 by Sebastian Bergmann.

error is here

$ php oil test
Tests Running...This may take a few moments.
PHP Fatal error:  Call to undefined method PHPUnit_Util_Configuration::getTestdoxGroupConfiguration() in D:\xampp\htdocs\basic\api\fuel\vendor\phpunit\phpunit\src\TextUI\TestRunner.php on line 1066

Fatal error: Call to undefined method PHPUnit_Util_Configuration::getTestdoxGroupConfiguration() in D:\xampp\htdocs\basic\api\fuel\vendor\phpunit\phpunit\src\TextUI\TestRunner.php on line 1066
Fatal Error - Call to undefined method PHPUnit_Util_Configuration::getTestdoxGroupConfiguration() in D:/xampp/htdocs/basic/api/fuel/vendor/phpunit/phpunit/src/TextUI/TestRunner.php on line 1066

my test code is here

use Fuel\Core\Cli;
use Fuel\Core\Config;
/**
 * @command php oil test --group=Admins
 * @command for this only >>> php oil test --file=fuel/app/tests/controller/admins.php
 * @group Admins
 */
class Test_Controller_Admins extends \TestCase {


    public function test_action_detail() {
        $this->assertTrue(true);
    }

    /**
     * setUp method
     *
     * @return void
     */
    public function setUp() {
        parent::setUp();
    }

    /**
     * tearDown method
     *
     * @return void
     */
    public function tearDown() {
        parent::tearDown();
    }

}

Solution

  • I solved it in this way. In below I places the steps how i solved it. this worked for me. Easiest way to obtain PHPUnit is to download a PHP Archive (PHAR).

    (1) Install PHPUNIT globally

    wget https://phar.phpunit.de/phpunit.phar
    chmod +x phpunit.phar
    sudo mv phpunit.phar /usr/local/bin/phpunit
    phpunit --version
    

    (2) Copy "fuel/packages/oil/config/oil.php" to "fuel/app/config/oil.php"

    (3) Change the binary path to

     'binary_path' => VENDORPATH.'bin/phpunit',  
    

    (4) now test your fuelphp

     fuelphp oil test