Yii Framework Forum: Fatal Error: Class 'ctestcase' Not Found - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Fatal Error: Class 'ctestcase' Not Found

#1 User is offline   testersack 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 07-July 13

Posted 07 July 2013 - 05:55 AM

Hello guys I am beginner to Yii framework. Every thing is working good in basics, but extending the classes is not working

Here is the code to check DB connection

<?php
class DBConnect extends CTestCase
{
public function testConnection()
{
$this->assertTrue(true);
}
}

The error which I get is as below in attachment

Attached File  DBerror.png (7.59K)
Number of downloads: 10

Can any 1 plz tell me whats the problem?

I am using mysql 5.6

php, pear n phpunit is all working find

Help me guys plz
0

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,193
  • Joined: 17-January 09
  • Location:Russia

Posted 07 July 2013 - 10:53 AM

It seems you're running phpunit not from protected/tests/ where phpunit.xml is.
Yii 2.0 Development Cookbook

Enjoying Yii? Star us at github

Support me so I can work more on Yii: https://www.patreon.com/samdark
0

#3 User is offline   testersack 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 07-July 13

Posted 07 July 2013 - 11:17 AM

View Postsamdark, on 07 July 2013 - 10:53 AM, said:

It seems you're running phpunit not from protected/tests/ where phpunit.xml is.

No I am running from that directory but still getting error. Any other chances?

This is the error which I am getting when I compile in cmd

Quote

c:\wamp\www\employee\protected\tests>phpunit unit\DBConnect.php
PHP Warning: require_once(PHPUnit/Extensions/SeleniumTestCase.php): failed to o
pen stream: No such file or directory in C:\wamp\www\yii\framework\test\CWebTest
Case.php on line 12
PHP Stack trace:
PHP 1. {main}() C:\wamp\bin\php\php5.4.16\PEAR\phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.4.16\PEAR\phpunit:4
6
PHP 3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.4.16\PEAR\pear\PHPUn
it\TextUI\Command.php:129
PHP 4. PHPUnit_TextUI_Command->handleArguments() C:\wamp\bin\php\php5.4.16\PEA
R\pear\PHPUnit\TextUI\Command.php:138
PHP 5. PHPUnit_TextUI_Command->handleBootstrap() C:\wamp\bin\php\php5.4.16\PEA
R\pear\PHPUnit\TextUI\Command.php:606
PHP 6. PHPUnit_Util_Fileloader::checkAndLoad() C:\wamp\bin\php\php5.4.16\PEAR\
pear\PHPUnit\TextUI\Command.php:778
PHP 7. PHPUnit_Util_Fileloader::load() C:\wamp\bin\php\php5.4.16\PEAR\pear\PHP
Unit\Util\Fileloader.php:76
PHP 8. include_once() C:\wamp\bin\php\php5.4.16\PEAR\pear\PHPUnit\Util\Fileloa
der.php:92
PHP 9. require_once() C:\wamp\www\employee\protected\tests\bootstrap.php:8
PHP 10. YiiBase::autoload() C:\wamp\www\employee\protected\tests\bootstrap.php:
0
PHP 11. include() C:\wamp\www\yii\framework\YiiBase.php:395

Warning: require_once(PHPUnit/Extensions/SeleniumTestCase.php): failed to open s
tream: No such file or directory in C:\wamp\www\yii\framework\test\CWebTestCase.
php on line 12

Call Stack:
0.0002 124456 1. {main}() C:\wamp\bin\php\php5.4.16\PEAR\phpunit:0
0.0062 360648 2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.4
.16\PEAR\phpunit:46
0.0062 363856 3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.4.
16\PEAR\pear\PHPUnit\TextUI\Command.php:129
0.0062 364072 4. PHPUnit_TextUI_Command->handleArguments() C:\wamp\bin
\php\php5.4.16\PEAR\pear\PHPUnit\TextUI\Command.php:138
0.0117 612688 5. PHPUnit_TextUI_Command->handleBootstrap() C:\wamp\bin
\php\php5.4.16\PEAR\pear\PHPUnit\TextUI\Command.php:606
0.0122 618664 6. PHPUnit_Util_Fileloader::checkAndLoad() C:\wamp\bin\p
hp\php5.4.16\PEAR\pear\PHPUnit\TextUI\Command.php:778
0.0126 618792 7. PHPUnit_Util_Fileloader::load() C:\wamp\bin\php\php5.
4.16\PEAR\pear\PHPUnit\Util\Fileloader.php:76
0.0128 621440 8. include_once('C:\wamp\www\employee\protected\tests\bo
otstrap.php') C:\wamp\bin\php\php5.4.16\PEAR\pear\PHPUnit\Util\Fileloader.php:92

0.0318 797944 9. require_once('C:\wamp\www\employee\protected\tests\We
bTestCase.php') C:\wamp\www\employee\protected\tests\bootstrap.php:8
0.0321 798248 10. YiiBase::autoload() C:\wamp\www\employee\protected\te
sts\bootstrap.php:0
0.0326 811872 11. include('C:\wamp\www\yii\framework\test\CWebTestCase.
php') C:\wamp\www\yii\framework\YiiBase.php:395

PHP Fatal error: require_once(): Failed opening required 'PHPUnit/Extensions/Se
leniumTestCase.php' (include_path='.;C:\wamp\bin\php\php5.4.16\PEAR\pear;C:\pear
php\pear') in C:\wamp\www\yii\framework\test\CWebTestCase.php on line 12
PHP Stack trace:
PHP 1. {main}() C:\wamp\bin\php\php5.4.16\PEAR\phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.4.16\PEAR\phpunit:4
6
PHP 3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.4.16\PEAR\pear\PHPUn
it\TextUI\Command.php:129
PHP 4. PHPUnit_TextUI_Command->handleArguments() C:\wamp\bin\php\php5.4.16\PEA
R\pear\PHPUnit\TextUI\Command.php:138
PHP 5. PHPUnit_TextUI_Command->handleBootstrap() C:\wamp\bin\php\php5.4.16\PEA
R\pear\PHPUnit\TextUI\Command.php:606
PHP 6. PHPUnit_Util_Fileloader::checkAndLoad() C:\wamp\bin\php\php5.4.16\PEAR\
pear\PHPUnit\TextUI\Command.php:778
PHP 7. PHPUnit_Util_Fileloader::load() C:\wamp\bin\php\php5.4.16\PEAR\pear\PHP
Unit\Util\Fileloader.php:76
PHP 8. include_once() C:\wamp\bin\php\php5.4.16\PEAR\pear\PHPUnit\Util\Fileloa
der.php:92
PHP 9. require_once() C:\wamp\www\employee\protected\tests\bootstrap.php:8
PHP 10. YiiBase::autoload() C:\wamp\www\employee\protected\tests\bootstrap.php:
0
PHP 11. include() C:\wamp\www\yii\framework\YiiBase.php:395

Fatal error: require_once(): Failed opening required 'PHPUnit/Extensions/Seleniu
mTestCase.php' (include_path='.;C:\wamp\bin\php\php5.4.16\PEAR\pear;C:\pearphp\p
ear') in C:\wamp\www\yii\framework\test\CWebTestCase.php on line 12

Call Stack:
0.0002 124456 1. {main}() C:\wamp\bin\php\php5.4.16\PEAR\phpunit:0
0.0062 360648 2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.4
.16\PEAR\phpunit:46
0.0062 363856 3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.4.
16\PEAR\pear\PHPUnit\TextUI\Command.php:129
0.0062 364072 4. PHPUnit_TextUI_Command->handleArguments() C:\wamp\bin
\php\php5.4.16\PEAR\pear\PHPUnit\TextUI\Command.php:138
0.0117 612688 5. PHPUnit_TextUI_Command->handleBootstrap() C:\wamp\bin
\php\php5.4.16\PEAR\pear\PHPUnit\TextUI\Command.php:606
0.0122 618664 6. PHPUnit_Util_Fileloader::checkAndLoad() C:\wamp\bin\p
hp\php5.4.16\PEAR\pear\PHPUnit\TextUI\Command.php:778
0.0126 618792 7. PHPUnit_Util_Fileloader::load() C:\wamp\bin\php\php5.
4.16\PEAR\pear\PHPUnit\Util\Fileloader.php:76
0.0128 621440 8. include_once('C:\wamp\www\employee\protected\tests\bo
otstrap.php') C:\wamp\bin\php\php5.4.16\PEAR\pear\PHPUnit\Util\Fileloader.php:92

0.0318 797944 9. require_once('C:\wamp\www\employee\protected\tests\We
bTestCase.php') C:\wamp\www\employee\protected\tests\bootstrap.php:8
0.0321 798248 10. YiiBase::autoload() C:\wamp\www\employee\protected\te
sts\bootstrap.php:0
0.0326 811872 11. include('C:\wamp\www\yii\framework\test\CWebTestCase.
php') C:\wamp\www\yii\framework\YiiBase.php:395

0

#4 User is offline   testersack 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 07-July 13

Posted 09 July 2013 - 03:18 AM

Hey just came here to see if any 1 can help me
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users