1 | <?php |
||
26 | class ConfigurationOptionsTest extends TestCase |
||
27 | { |
||
28 | public function testSetGetNamingStrategy() |
||
29 | { |
||
30 | $options = new Configuration(); |
||
31 | $options->setNamingStrategy(null); |
||
32 | $this->assertNull($options->getNamingStrategy()); |
||
33 | |||
34 | $options->setNamingStrategy('test'); |
||
35 | $this->assertSame('test', $options->getNamingStrategy()); |
||
36 | |||
37 | $namingStrategy = $this->getMock('Doctrine\ORM\Mapping\NamingStrategy'); |
||
38 | $options->setNamingStrategy($namingStrategy); |
||
39 | $this->assertSame($namingStrategy, $options->getNamingStrategy()); |
||
40 | |||
41 | $this->setExpectedException('Zend\Stdlib\Exception\InvalidArgumentException'); |
||
42 | $options->setNamingStrategy(new \stdClass()); |
||
|
|||
43 | } |
||
44 | |||
45 | public function testSetGetQuoteStrategy() |
||
61 | |||
62 | public function testSetRepositoryFactory() |
||
63 | { |
||
64 | $options = new Configuration(); |
||
65 | $options->setRepositoryFactory(null); |
||
66 | $this->assertNull($options->getRepositoryFactory()); |
||
67 | |||
68 | $options->setRepositoryFactory('test'); |
||
69 | $this->assertSame('test', $options->getRepositoryFactory()); |
||
70 | |||
71 | $repositoryFactory = new DefaultRepositoryFactory(); |
||
72 | $options->setRepositoryFactory($repositoryFactory); |
||
73 | $this->assertSame($repositoryFactory, $options->getRepositoryFactory()); |
||
74 | |||
75 | $this->setExpectedException('Zend\Stdlib\Exception\InvalidArgumentException'); |
||
76 | $options->setRepositoryFactory(new \stdClass()); |
||
77 | } |
||
78 | |||
79 | public function testSetGetEntityListenerResolver() |
||
97 | } |
||
98 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: