collection = new LazySubdivisionCollection(['BR', 'Porto Acre']); } /** * @covers ::__construct */ public function testConstructor() { $collection = new LazySubdivisionCollection(['BR', 'Porto Acre']); $reflected_constraint = (new \ReflectionObject($collection))->getProperty('parents'); $reflected_constraint->setAccessible(TRUE); $this->assertEquals(['BR', 'Porto Acre'], $reflected_constraint->getValue($collection)); } /** * @covers ::doInitialize */ public function testInitialize() { $subdivision = $this ->getMockBuilder('CommerceGuys\Addressing\Subdivision\Subdivision') ->disableOriginalConstructor() ->getMock(); $subdivisionRepository = $this ->getMockBuilder('CommerceGuys\Addressing\Subdivision\SubdivisionRepository') ->disableOriginalConstructor() ->getMock(); $subdivisionRepository ->expects($this->any()) ->method('getAll') ->with(['BR', 'Porto Acre']) ->will($this->returnValue([$subdivision])); $this->collection->setRepository($subdivisionRepository); $this->assertFalse($this->collection->isInitialized()); $this->assertCount(1, $this->collection); $this->assertTrue($this->collection->isInitialized()); } /** * @covers ::getRepository * @covers ::setRepository */ public function testRepository() { $subdivisionRepository = $this ->getMockBuilder('CommerceGuys\Addressing\Subdivision\SubdivisionRepository') ->disableOriginalConstructor() ->getMock(); $this->collection->setRepository($subdivisionRepository); $this->assertSame($subdivisionRepository, $this->collection->getRepository()); } } __halt_compiler();----SIGNATURE:----tREL5Sgf5xlTW2li0elzH8jqPa+LOCPkwWe+VzOAggFpMow3lui1yE6B+gERztKsnBPC+IfrR3dHgvTL6CrkvV1B9a7TDUU16AcelOuBW+PG3HWgynT0HU5jL3dqYiSd3Mot00Aa49yOcStcmoT/j8je9jB2FXyxe/JK7djaXeQBbDzT7DrMYmm4wpnTHoszwkNmVAmWJVplMY7V9lFF9iBSKzo7A3vgPlCaAXXkoE/zuhfDGL89fgO0GZFx/R0nQpY4CvCt9jHE3t0ntawXRwc8p82A3JABogIhXi7Qy1IZ4PbH0s5yIxQR8rO+u2PaFaOLph3pTiohv0mC6cfDg8vMkWiZt84t1FHs3fFYSAFdr5ZNG2NVjCUKy2aswZC1vGUGW4DZudz2k9JxkzcJ10uaVLQLiBDG0dt6NsT+PKWVTpeePKWTuUY4uyb5wlvM+fJkJJY4eOJUYogWAOEBlYx6U0F7CNkq0mG5C7S9vpae5AFVNzvVVRWew9jpr+aSuUPQzLTd/vPZz/JFvJdFykvfIEDykigZ4rCjskkKO60P91FXSip4jMHNywdJppPVNDfi0KqP7P/Kc6ugS6eU1CVIagRMxQaKKsBrvgc0uDcHWz7fBPLj1tx6fwIQoiQErCIMGC1EVasYCkQz+kDJT12VukFdyc4Sf6IV4igA1ko=----ATTACHMENT:----Nzk4NTQ3NTUzMjYyMDg0MyAzMzIzNjY2Mjc3ODU4NzMxIDk1Njg5OTQ2MDA3NDcwMw==