Exemplo n.º 1
0
 public function testUpdateNull()
 {
     $author = new Author();
     $ret = $author->create(array('name' => 'Mary III', 'email' => 'zz3@zz3', 'identity' => 'zz3'));
     $this->assertResultSuccess($ret);
     $id = $author->id;
     $this->assertResultSuccess($author->update(array('name' => 'I')));
     is($id, $author->id);
     is('I', $author->name);
     $ret = $author->update(array('name' => null));
     $this->assertResultSuccess($ret);
     $this->assertEquals($id, $author->id);
     $this->assertNull($author->name, 'updated name should be null');
     $author = new Author();
     $ret = $author->load($id);
     $this->assertResultSuccess($ret);
     $this->assertEquals($id, $author->id);
     $this->assertNull($author->name, 'loaded name should be null');
 }
Exemplo n.º 2
0
 public function testUpdateNull()
 {
     $author = new Author();
     $ret = $author->create(array('name' => 'Mary III', 'email' => 'zz3@zz3', 'identity' => 'zz3'));
     $this->resultOK(true, $ret);
     $id = $author->id;
     $ret = $author->update(array('name' => 'I'));
     $this->resultOK(true, $ret);
     is($id, $author->id);
     is('I', $author->name);
     $ret = $author->update(array('name' => null));
     $this->resultOK(true, $ret);
     is($id, $author->id);
     is(null, $author->name);
     $ret = $author->load($author->id);
     $this->resultOK(true, $ret);
     is($id, $author->id);
     is(null, $author->name);
 }
Exemplo n.º 3
0
 public function testUpdateNull()
 {
     $author = new Author();
     $ret = $author->create(array('name' => 'Mary III', 'email' => 'zz3@zz3', 'identity' => 'zz3'));
     result_ok($ret);
     $id = $author->id;
     ok($author->update(array('name' => 'I'))->success);
     is($id, $author->id);
     is('I', $author->name);
     ok($author->update(array('name' => null))->success);
     is($id, $author->id);
     is(null, $author->name);
     ok($author->load($author->id)->success);
     is($id, $author->id);
     is(null, $author->name);
 }