Пример #1
0
 function testSavingUnchecked()
 {
     /* Create a new test data record */
     $article = new CheckboxFieldTest_Article();
     /* Create a field, with no value */
     $field = new CheckboxField('IsChecked', 'Checked');
     /* Save the field into our Article object */
     $field->saveInto($article);
     /* Write the record to the test database */
     $article->write();
     /* Check that IsChecked column contains a 0 */
     $this->assertEquals(DB::query("SELECT IsChecked FROM CheckboxFieldTest_Article")->value(), 0, 'We have a 0 set in the database, because the field saved into as a 0');
     /* Delete the record we tested */
     $article->delete();
 }