Class 'MongoId' not found when running all tests #937

Closed
ComFreek opened this Issue May 16, 2013 · 3 comments

Projects

None yet

3 participants

@ComFreek

What I did

I cloned the latest Lithium core and framework versions. I did not change any file. The resources directory is per Lithium's default home page writable.

git clone git://github.com/UnionOfRAD/framework.git my_app
cd my_app
git submodule init
git submodule update

Submodule version hash:

Submodule path 'libraries/lithium': checked out 'dd286f48e35cd366170a9047c42f5979b5eff56b'

The home page works just fine but when I try to execute all tests (my_app/test/all), PHP outputs the error below:

Fatal error: Class 'MongoId' not found in P:\Websites\Apache\my_app\libraries\lithium\data\source\mongo_db\Schema.php on line 42

Stack trace:

#   Time    Memory  Function    Location
1   0.0002  143168  {main}( )   ..\index.php:0
2   0.0163  1932544 lithium\action\Dispatcher::run( )   ..\index.php:41
3   0.0164  1933680 lithium\core\StaticObject::_filter( )   ..\Dispatcher.php:155
4   0.0164  1935360 lithium\util\collection\Filters::run( ) ..\StaticObject.php:147
5   0.0164  1937560 {closure:P:\Websites\Apache\my_app\app\config\bootstrap\action.php:41-52}( )    ..\Filters.php:184
6   0.0174  1961368 lithium\util\collection\Filters->next( )    ..\action.php:51
7   0.0175  1961520 {closure:P:\Websites\Apache\my_app\app\config\bootstrap\cache.php:41-57}( ) ..\Filters.php:203
8   0.0175  1961520 lithium\util\collection\Filters->next( )    ..\cache.php:43
9   0.0175  1961608 lithium\action\Dispatcher::lithium\action\{closure}( )  ..\Filters.php:203
10  0.0186  2001944 lithium\core\StaticObject::invokeMethod( )  ..\Dispatcher.php:154
11  0.0186  2002000 lithium\action\Dispatcher::_call( ) ..\StaticObject.php:85
12  0.0186  2003072 lithium\core\StaticObject::_filter( )   ..\Dispatcher.php:265
13  0.0186  2003304 lithium\action\Dispatcher::lithium\action\{closure}( )  ..\StaticObject.php:140
14  0.0186  2003336 lithium\test\Controller->__invoke( )    ..\Dispatcher.php:262
15  0.0186  2005984 lithium\core\Object->_filter( ) ..\Controller.php:72
16  0.0186  2006312 lithium\test\Controller->lithium\test\{closure}( )  ..\Object.php:259
17  0.0734  2074256 lithium\test\Dispatcher::run( ) ..\Controller.php:60
18  0.1194  2169048 lithium\core\StaticObject::_filter( )   ..\Dispatcher.php:73
19  0.1194  2169296 lithium\test\Dispatcher::lithium\test\{closure}( )  ..\StaticObject.php:140
20  0.1194  2169440 lithium\test\Report->run( ) ..\Dispatcher.php:69
21  0.2042  15800912    run ( ) ..\Report.php:146
22  0.2042  15801128    lithium\util\Collection->__call( )  ..\Report.php:146
23  0.2042  15801168    lithium\util\Collection->invoke( )  ..\Collection.php:208
24  111.532 34819536    call_user_func_array ( )    ..\Collection.php:194
25  111.532 34819856    lithium\test\Unit->run( )   ..\Collection.php:194
26  111.542 34838128    lithium\test\Unit->_runTestMethod( )    ..\Unit.php:205
27  111.543 34843464    lithium\core\Object->_filter( ) ..\Unit.php:811
28  111.543 34843712    lithium\test\Unit->lithium\test\{closure}( )    ..\Object.php:259
29  111.543 34843928    lithium\tests\cases\data\collection\DocumentSetTest->testInitialCastingOnSubObject( )   ..\Unit.php:807
30  111.543 34853224    lithium\data\Collection->__construct( ) ..\DocumentSetTest.php:80
31  111.543 34853856    lithium\core\Object->__construct( ) ..\Collection.php:120
32  111.543 34854328    lithium\data\collection\DocumentSet->_init( )   ..\Object.php:95
33  111.543 34854328    lithium\data\Collection->_init( )   ..\DocumentSet.php:24
34  111.543 34854208    lithium\data\Collection->set( ) ..\Collection.php:126
35  111.543 34854504    lithium\data\Collection->offsetSet( )   ..\Collection.php:202
36  111.543 34854504    lithium\data\collection\DocumentSet->_set( )    ..\Collection.php:244
37  111.544 34855248    lithium\data\DocumentSchema->cast( )    ..\DocumentSet.php:117
38  111.544 34856240    lithium\data\DocumentSchema->_castArray( )  ..\DocumentSchema.php:52
39  111.544 34857784    lithium\data\Source->item( )    ..\DocumentSchema.php:87
40  111.544 34859552    lithium\core\Object->_instance( )   ..\Source.php:270
41  111.544 34859584    lithium\core\Libraries::instance( ) ..\Object.php:234
42  111.544 34861280    lithium\core\Libraries::lithium\core\{closure}( )   ..\Libraries.php:704
43  111.544 34862968    lithium\data\Entity->__construct( ) ..\Libraries.php:701
44  111.544 34863976    lithium\core\Object->__construct( ) ..\Entity.php:131
45  111.544 34864672    lithium\data\entity\Document->_init( )  ..\Object.php:95
46  111.545 34864928    lithium\data\entity\Document->set( )    ..\Document.php:104
47  111.545 34866672    lithium\data\DocumentSchema->cast( )    ..\Document.php:324
48  111.545 34867632    lithium\data\DocumentSchema->_castArray( )  ..\DocumentSchema.php:52
49  111.545 34867816    lithium\data\DocumentSchema->_castType( )   ..\DocumentSchema.php:63
50  111.545 34867840    lithium\data\source\mongo_db\Schema->lithium\data\source\mongo_db\{closure}( )  ..\DocumentSchema.php:120

My system

  • Windows 8 Pro 64-bit
  • Apache/2.4.3
  • PHP/5.5.0beta3 (32-bit, Thread safe)

Document root: P:/Websites/Apache
Lithium my_app directory: P:/Websites/Apache/my_app
AllowOverride: All

  • APC is not installed.
  • Any non-standard extensions: X-Debug 2.2.2 PHP 5.5 VC11 TS (32 bit)
@gwoo
Union of RAD member

The document set test should not be using mongo.
lithium\tests\cases\data\collection\DocumentSetTest->testInitialCastingOnSubObject( )

@davidpersson
Union of RAD member

@joebeeson Did your PR #991 fix the issue above? If yes we can close this ticket.

@davidpersson
Union of RAD member

Closing as this ticket seems to solved as no additional feedback was given.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment