Sonata\tests\CustomerBundle\Entity\BaseCustomerTest::testAddAddress PHP Method

testAddAddress() public method

public testAddAddress ( )
    public function testAddAddress()
    {
        $customer = new CustomerTest();
        $address = new AddressTest();
        $address->setType(AddressInterface::TYPE_BILLING);
        $customer->addAddress($address);
        $this->assertTrue($address->getCurrent());
        $address2 = new AddressTest();
        $address2->setType(AddressInterface::TYPE_BILLING);
        $customer->addAddress($address2);
        $this->assertFalse($address2->getCurrent());
        $address = new AddressTest();
        $address->setType(AddressInterface::TYPE_CONTACT);
        $customer->addAddress($address);
        $this->assertTrue($address->getCurrent());
        $address2 = new AddressTest();
        $address2->setType(AddressInterface::TYPE_CONTACT);
        $customer->addAddress($address2);
        $this->assertFalse($address2->getCurrent());
    }
BaseCustomerTest