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 testSetRepositoryFactory() |
||
46 | { |
||
47 | $options = new Configuration(); |
||
48 | $options->setRepositoryFactory(null); |
||
49 | $this->assertNull($options->getRepositoryFactory()); |
||
50 | |||
51 | $options->setRepositoryFactory('test'); |
||
52 | $this->assertSame('test', $options->getRepositoryFactory()); |
||
53 | |||
54 | $repositoryFactory = new DefaultRepositoryFactory(); |
||
55 | $options->setRepositoryFactory($repositoryFactory); |
||
56 | $this->assertSame($repositoryFactory, $options->getRepositoryFactory()); |
||
57 | |||
58 | $this->setExpectedException('Zend\Stdlib\Exception\InvalidArgumentException'); |
||
59 | $options->setRepositoryFactory(new \stdClass()); |
||
60 | } |
||
61 | |||
62 | public function testSetGetEntityListenerResolver() |
||
80 | |||
81 | public function testDefaultQueryHint() |
||
82 | { |
||
88 | } |
||
89 |
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: