コード例 #1
0
ファイル: MapperTest.php プロジェクト: blackshawk/flipper
 public function testSimpleMultipleObjectMap()
 {
     $set = ['author_id' => 1, 'name' => 'Jack London', 'birth' => '1/12/1876', 'post_id' => 3, 'title' => 'White Fang', 'body' => 'Dark spruce forest frowned on either side the frozen waterway.'];
     $results = $this->mapper->mapOne(['Author', 'Post'], $set, $split = ['post_id']);
     $this->assertSame(1, $results['author']->author_id);
     $this->assertSame('Jack London', $results['author']->name);
     $this->assertSame('1/12/1876', $results['author']->birth);
     $this->assertSame(3, $results['post']->getPostId());
     $this->assertSame('White Fang', $results['post']->getTitle());
     $this->assertStringStartsWith('Dark spruce forest', $results['post']->getBody());
 }