Phactory\Sql\PhactoryTest::testCreateWithAssociationsGuessingFromColumn PHP Method

testCreateWithAssociationsGuessingFromColumn() public method

    public function testCreateWithAssociationsGuessingFromColumn()
    {
        $this->phactory->define('role', array('name' => 'admin'));
        $this->phactory->define('user', array('name' => 'testuser'), array('role' => $this->phactory->manyToOne('role')));
        $role = $this->phactory->create('role');
        $user = $this->phactory->createWithAssociations('user', array('role' => $role));
        $this->assertNotNull($role->id);
        $this->assertEquals($role->id, $user->role_id);
    }