Example #1
0
 public function testGetMapper()
 {
     $this->assertInstanceOf('Mawelous\\Yamop\\Mapper', \Model\Article::getMapper());
     $this->assertInstanceOf('\\Mapper\\AuthorMapper', \Model\Author::getMapper());
 }
Example #2
0
 public function testJoinToNull()
 {
     $this->_saveArticleWithAuthor();
     self::$_dbConnection->articles->insert(array('title' => 'test', 'author' => null));
     $articles = \Model\Article::getMapper()->find()->join('author', '\\Model\\Author')->get();
     $article = array_shift($articles);
     $this->assertAttributeNotEmpty('author', $article);
     $this->assertAttributeInstanceOf('\\Model\\Author', 'author', $article);
     $article = array_shift($articles);
     $this->assertAttributeSame(null, 'author', $article);
 }