/** * Test children */ public function testAddressesToTypesCollection() { static::assertPropertyCollections($this->address, [['addressesToTypes', new CustomerAddressToAddressType()]]); $addressToType = $this->createAddressToTypeEntity(); $this->assertInstanceOf('OroB2B\\Bundle\\CustomerBundle\\Entity\\CustomerAddress', $this->address->addAddressesToType($addressToType)); $this->assertCount(1, $this->address->getAddressesToTypes()); // duplicate add should be ignored $this->address->addAddressesToType($addressToType); $this->assertCount(1, $this->address->getAddressesToTypes()); $otherAddressToType = $this->createAddressToTypeEntity(); $this->assertInstanceOf('OroB2B\\Bundle\\CustomerBundle\\Entity\\CustomerAddress', $this->address->removeAddressesToType($otherAddressToType)); $this->assertCount(1, $this->address->getAddressesToTypes()); $this->address->removeAddressesToType($addressToType); $this->assertCount(0, $this->address->getAddressesToTypes()); }