コード例 #1
0
 public function testSaveItemData()
 {
     $this->item->saveItemData(array('text' => array('test_field' => 'test text'), 'integer' => array('test_integer' => 10), 'datetime' => array('test_datetime' => new \DateTime('2013-01-01')), 'decimal' => array('test_decimal' => 10.26)));
     $textFields = $this->item->getTextFields();
     $this->assertEquals('test text', $textFields->get(0)->getValue());
     $integerFields = $this->item->getIntegerFields();
     $this->assertEquals(10, $integerFields->get(0)->getValue());
     $datetimeFields = $this->item->getDatetimeFields();
     $this->assertEquals('2013-01-01', $datetimeFields->get(0)->getValue()->format('Y-m-d'));
     $decimalFields = $this->item->getDecimalFields();
     $this->assertEquals(10.26, $decimalFields->get(0)->getValue());
 }