コード例 #1
0
 /** @test */
 public function it_can_be_cleared()
 {
     $book1 = new Book(Uuid::fromString('a7f0a5b1-b65a-4f9b-905b-082e255f6038'), 'Domain-Driven Design', 'Eric Evans', '0321125215');
     $book2 = new Book(Uuid::fromString('38483e7a-e815-4657-bc94-adc83047577e'), 'REST in Practice', 'Jim Webber, Savas Parastatidis, Ian Robinson', '978-0596805821');
     $this->repository->save($book1);
     $this->repository->save($book2);
     $this->repository->clear();
     $this->assertEmpty($this->repository->getAll());
 }
コード例 #2
0
 protected function addBook($bookId, $title, $authors, $isbn)
 {
     $this->books->save(new Book(Uuid::fromString($bookId), $title, $authors, $isbn));
 }
コード例 #3
0
 private function addBook(UuidInterface $bookId, $title, $authors, $isbn)
 {
     $this->repository->save(new Book($bookId, $title, $authors, $isbn));
 }