|
@@ 86-107 (lines=22) @@
|
| 83 |
|
$this->resolver->resolve($className); |
| 84 |
|
} |
| 85 |
|
|
| 86 |
|
public function testClearOne() |
| 87 |
|
{ |
| 88 |
|
$className1 = '\Doctrine\Bundle\DoctrineBundle\Tests\Mapping\EntityListener1'; |
| 89 |
|
$className2 = '\Doctrine\Bundle\DoctrineBundle\Tests\Mapping\EntityListener2'; |
| 90 |
|
|
| 91 |
|
$obj1 = $this->resolver->resolve($className1); |
| 92 |
|
$obj2 = $this->resolver->resolve($className2); |
| 93 |
|
|
| 94 |
|
$this->assertInstanceOf($className1, $obj1); |
| 95 |
|
$this->assertInstanceOf($className2, $obj2); |
| 96 |
|
|
| 97 |
|
$this->assertSame($obj1, $this->resolver->resolve($className1)); |
| 98 |
|
$this->assertSame($obj2, $this->resolver->resolve($className2)); |
| 99 |
|
|
| 100 |
|
$this->resolver->clear($className1); |
| 101 |
|
|
| 102 |
|
$this->assertInstanceOf($className1, $this->resolver->resolve($className1)); |
| 103 |
|
$this->assertInstanceOf($className2, $this->resolver->resolve($className2)); |
| 104 |
|
|
| 105 |
|
$this->assertNotSame($obj1, $this->resolver->resolve($className1)); |
| 106 |
|
$this->assertSame($obj2, $this->resolver->resolve($className2)); |
| 107 |
|
} |
| 108 |
|
|
| 109 |
|
public function testClearAll() |
| 110 |
|
{ |
|
@@ 109-130 (lines=22) @@
|
| 106 |
|
$this->assertSame($obj2, $this->resolver->resolve($className2)); |
| 107 |
|
} |
| 108 |
|
|
| 109 |
|
public function testClearAll() |
| 110 |
|
{ |
| 111 |
|
$className1 = '\Doctrine\Bundle\DoctrineBundle\Tests\Mapping\EntityListener1'; |
| 112 |
|
$className2 = '\Doctrine\Bundle\DoctrineBundle\Tests\Mapping\EntityListener2'; |
| 113 |
|
|
| 114 |
|
$obj1 = $this->resolver->resolve($className1); |
| 115 |
|
$obj2 = $this->resolver->resolve($className2); |
| 116 |
|
|
| 117 |
|
$this->assertInstanceOf($className1, $obj1); |
| 118 |
|
$this->assertInstanceOf($className2, $obj2); |
| 119 |
|
|
| 120 |
|
$this->assertSame($obj1, $this->resolver->resolve($className1)); |
| 121 |
|
$this->assertSame($obj2, $this->resolver->resolve($className2)); |
| 122 |
|
|
| 123 |
|
$this->resolver->clear(); |
| 124 |
|
|
| 125 |
|
$this->assertInstanceOf($className1, $this->resolver->resolve($className1)); |
| 126 |
|
$this->assertInstanceOf($className2, $this->resolver->resolve($className2)); |
| 127 |
|
|
| 128 |
|
$this->assertNotSame($obj1, $this->resolver->resolve($className1)); |
| 129 |
|
$this->assertNotSame($obj2, $this->resolver->resolve($className2)); |
| 130 |
|
} |
| 131 |
|
|
| 132 |
|
/** |
| 133 |
|
* @expectedException \InvalidArgumentException |