Sonata\Test\Component\Generator\MysqlReferenceTest::testOrder PHP Method

testOrder() public method

public testOrder ( )
    public function testOrder()
    {
        $order = new OrderMock();
        $mysqlReference = $this->generateNewObject();
        try {
            $mysqlReference->order($order);
            $this->fail('->order() call should raise a \\RuntimeException for a new entity');
        } catch (\Exception $e) {
            $this->assertInstanceOf('\\RuntimeException', $e);
        }
        $order->setId(12);
        try {
            $this->assertNull($mysqlReference->order($order));
        } catch (\Exception $e) {
            $this->fail('->order() should return a NULL value but should not throw an \\Exception');
        }
    }