<?php
namespace
{
class Bar
{
}
class Test
{
}
}
namespace tests\units
{
$loader = require __DIR__ . '/../../vendor/autoload.php';
class Foo
{
public function bar(\Bar $b)
{
return $b;
}
public function dom(\simple_html_dom $dom)
{
}
}
class Test extends \mageekguy\atoum\test
{
public function test1()
{
$mocked = new \mock\tests\units\Foo();
}
}
}
?>
And i got:
> There is 1 exception:
=> tests\units\Test::test1():
==> Exception throwed in file /Users/[...]/tests/units/Test.php on line 42:
==> exception 'ReflectionException' with message 'Class simple_html_dom does not exist' in /Users/[...]/vendor/atoum/atoum/classes/mock/generator.php:411
==> Stack trace:
==> #0 /Users/[...]/vendor/atoum/atoum/classes/mock/generator.php(411): ReflectionParameter->getClass()
==> #1 /Users/[...]/vendor/atoum/atoum/classes/mock/generator.php(430): mageekguy\atoum\mock\generator::getParameterType(Object(ReflectionParameter))
==> #2 /Users/[...]/vendor/atoum/atoum/classes/mock/generator.php(266): mageekguy\atoum\mock\generator->getParameters(Object(ReflectionMethod), false)
==> #3 /Users/[...]/vendor/atoum/atoum/classes/mock/generator.php(386): mageekguy\atoum\mock\generator->generateClassMethodCode(Object(ReflectionClass))
==> #4 /Users/[...]/vendor/atoum/atoum/classes/mock/generator.php(187): mageekguy\atoum\mock\generator->generateClassCode(Object(ReflectionClass), '\mock\tests\uni...', 'Foo')
==> #5 /Users/[...]/vendor/atoum/atoum/classes/mock/generator.php(195): mageekguy\atoum\mock\generator->getMockedClassCode('tests\units\Foo', NULL, NULL)
==> #6 /Users/[...]/vendor/atoum/atoum/classes/test.php(783): mageekguy\atoum\mock\generator->generate('tests\units\Foo')
==> #7 [internal function]: mageekguy\atoum\{closure}('mock\tests\unit...')
==> #8 /Users/[...]/tests/units/Test.php(42): spl_autoload_call('mock\tests\unit...')
==> #9 /Users/[...]/vendor/atoum/atoum/classes/test.php(838): tests\units\Test->test1()
==> #10 -(1): mageekguy\atoum\test->runTestMethod('test1')
==> #11 {main}
I guess the problem is in the sunra package but, is there a way to avoid this ?
I used composer.phar and here my composer.json:
I try:
And i got:
I guess the problem is in the sunra package but, is there a way to avoid this ?