Ejemplo n.º 1
0
 public function test_delete()
 {
     $as = XAppSession::begin();
     $name = "testname_delete";
     $authorService = new AuthorService();
     $author = $authorService->add($name);
     $as->commit();
     $this->logger->info("Author status before: " . $author->getStatus());
     $this->assertTrue(!is_null($author) && $author->getStatus() == Constants::USING);
     $author = $authorService->delete($author->id());
     $as->commit();
     $this->logger->info("Author status after: " . $author->getStatus());
     $this->assertTrue(!is_null($author) && $author->getStatus() == Constants::DELETED);
     Dwriter::ins()->del_Author_by_id($author->id());
     $as->commit();
     $as = null;
 }
Ejemplo n.º 2
0
 public function test_delete()
 {
     $as = XAppSession::begin();
     $name = "testname_delete";
     $authorid = "3";
     $bookService = new BookService();
     $book = $bookService->add($name, $authorid);
     $as->commit();
     $this->logger->info("Book status before: " . $book->getStatus());
     $this->assertTrue(!is_null($book) && $book->getStatus() == Constants::USING);
     $book = $bookService->delete($book->id());
     $as->commit();
     $this->logger->info("Book status after: " . $book->getStatus());
     $this->assertTrue(!is_null($book) && $book->getStatus() == Constants::DELETED);
     Dwriter::ins()->del_Book_by_id($book->id());
     $as->commit();
     $as = null;
     return;
 }