public function testSetDefaults() { $types = new ArrayCollection([$this->billingType, $this->shippingType]); $this->assertCount(0, $this->address->getDefaults()); $this->address->setTypes($types); $this->assertCount(0, $this->address->getDefaults()); $this->assertInstanceOf('OroB2B\\Bundle\\CustomerBundle\\Entity\\CustomerAddress', $this->address->setDefaults([$this->billingType])); $this->assertCount(1, $this->address->getDefaults()); $this->address->setDefaults([$this->billingType, $this->shippingType]); $this->assertCount(2, $this->address->getDefaults()); $this->address->setTypes(new ArrayCollection([$this->billingType])); $this->assertCount(0, $this->address->getDefaults()); $this->address->setDefaults([$this->shippingType]); $this->assertCount(0, $this->address->getDefaults()); }