public function testGetDefaults() { $this->assertCount(0, $this->address->getDefaults()); $this->assertInstanceOf('Doctrine\\Common\\Collections\\ArrayCollection', $this->address->getDefaults()); $this->address->addType($this->billingType); $this->assertCount(0, $this->address->getDefaults()); /** @var CustomerAddressToAddressType $addressToTypes */ $addressesToTypesArray = $this->address->getAddressesToTypes()->toArray(); $addressToTypes = array_shift($addressesToTypesArray); $addressToTypes->setDefault(true); $this->assertCount(1, $this->address->getDefaults()); }