Pheasant\Tests\BasicMappingTest::testImport PHP Method

testImport() public method

public testImport ( )
    public function testImport()
    {
        $posts = Post::import(array(array('title' => 'First Post'), array('title' => 'Second Post')));
        $this->assertEquals(count($posts), 2);
        $this->assertEquals($posts[0]->postid, 1);
        $this->assertEquals($posts[1]->postid, 2);
        $this->assertEquals($posts[0]->title, 'First Post');
        $this->assertEquals($posts[1]->title, 'Second Post');
        $this->assertTrue($posts[0]->isSaved());
        $this->assertTrue($posts[1]->isSaved());
    }