1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
<?php declare(strict_types=1);
namespace DeepCopyTest\Filter\Doctrine;
use BadMethodCallException;
use DeepCopy\Filter\Doctrine\DoctrineProxyFilter;
use PHPUnit\Framework\TestCase;
/**
* @covers \DeepCopy\Filter\Doctrine\DoctrineProxyFilter
*/
class DoctrineProxyFilterTest extends TestCase
{
public function test_it_loads_the_doctrine_proxy()
{
$foo = new Foo();
$filter = new DoctrineProxyFilter();
$filter->apply(
$foo,
'unknown',
function($item) {
throw new BadMethodCallException('Did not expect to be called.');
}
);
$this->assertTrue($foo->isLoaded);
}
}
class Foo
{
public $isLoaded = false;
public function __load()
{
$this->isLoaded = true;
}
}
|