Exemplo n.º 1
0
 /**
  * Tests the Base[Object]::setByName() method
  */
 public function testSetByName()
 {
     $book = new Book();
     $types = array(BasePeer::TYPE_PHPNAME => 'Title', BasePeer::TYPE_STUDLYPHPNAME => 'title', BasePeer::TYPE_COLNAME => 'book.TITLE', BasePeer::TYPE_FIELDNAME => 'title', BasePeer::TYPE_NUM => 1);
     $title = 'Harry Potter and the Order of the Phoenix';
     foreach ($types as $type => $name) {
         $book->setByName($name, $title, $type);
         $result = $book->getTitle();
         $this->assertEquals($title, $result);
     }
 }
Exemplo n.º 2
0
 /**
  * Tests the Base[Object]::setByName() method
  */
 public function testSetByName()
 {
     $book = new Book();
     $types = [TableMap::TYPE_PHPNAME => 'Title', TableMap::TYPE_CAMELNAME => 'title', TableMap::TYPE_COLNAME => 'book.title', TableMap::TYPE_FIELDNAME => 'title', TableMap::TYPE_NUM => 1];
     $title = 'Harry Potter and the Order of the Phoenix';
     foreach ($types as $type => $name) {
         $book->setByName($name, $title, $type);
         $result = $book->getTitle();
         $this->assertEquals($title, $result);
     }
 }