Example #1
0
 public function testSoftDeleteExisting()
 {
     $m = new Model(3);
     $m->inactive = 0;
     $m->soft_delete();
     $this->assertSame(1, $m->inactive);
     $queryTable = $this->tableFromQuery('SELECT prim, test_attr1, test_attr2, test_attr3, inactive FROM model_test_table');
     $expectedTable = $this->tableFromArray(array(array('prim' => 1, 'test_attr1' => 4, 'test_attr2' => 6, 'test_attr3' => 'foo', 'inactive' => 0), array('prim' => 2, 'test_attr1' => 5, 'test_attr2' => 6, 'test_attr3' => 'foo', 'inactive' => 0), array('prim' => 3, 'test_attr1' => 5, 'test_attr2' => 7, 'test_attr3' => 'foo', 'inactive' => 1)));
     $this->assertTablesEqual($expectedTable, $queryTable);
 }