lithium\tests\integration\data\CrudTest::testCreate PHP Метод

testCreate() публичный Метод

Tests that a single record with a manually specified primary key can be created, persisted to an arbitrary data store, re-read and updated.
public testCreate ( )
    public function testCreate()
    {
        $this->assertIdentical(0, Galleries::count());
        $new = Galleries::create(array('name' => 'Flowers', 'active' => true));
        $expected = array('name' => 'Flowers', 'active' => true);
        $result = $new->data();
        $this->assertEqual($expected['name'], $result['name']);
        $this->assertEqual($expected['active'], $result['active']);
        $this->assertEqual(array(false, true, true), array($new->exists(), $new->save(), $new->exists()));
        $this->assertIdentical(1, Galleries::count());
    }