public function testBadBook()
 {
     $this->setUp();
     $search = new \App\Services\BookSearch($this->books);
     $results = $search->find('The Definitive Guide to Symfony', true);
     $this->assertNotContains('The Definitive Guide to Symfony', $results, '', true);
 }
Example #2
0
 public function testFalseSubsetFromSearch()
 {
     $books = [['title' => 'Introduction to HTML and CSS', 'pages' => 432], ['title' => 'Learning JavaScript Design Patterns', 'pages' => 32], ['title' => 'Object Oriented JavaScript', 'pages' => 42], ['title' => 'JavaScript Web Applications', 'pages' => 99], ['title' => 'PHP Object Oriented Solutions', 'pages' => 80], ['title' => 'PHP Design Patterns', 'pages' => 300], ['title' => 'Head First Java', 'pages' => 200]];
     $search = new \App\Services\BookSearch($books);
     $results = $search->find('The Definitive Guide to Symfony', true);
     $this->assertEquals(false, $results);
 }
 public function testBookSearchFindReturnsFalse()
 {
     // Arrange
     $search = new \App\Services\BookSearch($this->books);
     // Act
     $results = $search->findExact('The Definitive Guide to Symfony', true);
     // Assert
     $this->assertFalse($results);
 }
 public function testCaseIfExists()
 {
     $books = [['title' => 'Introduction to HTML and CSS', 'pages' => 432], ['title' => 'Learning JavaScript Design Patterns', 'pages' => 32], ['title' => 'Object Oriented JavaScript', 'pages' => 42], ['title' => 'JavaScript Web Applications', 'pages' => 99], ['title' => 'PHP Object Oriented Solutions', 'pages' => 80], ['title' => 'PHP Design Patterns', 'pages' => 300], ['title' => 'Head First Java', 'pages' => 200]];
     // Arrange
     $search = new \App\Services\BookSearch($books);
     // Act
     $results = $search->find('The Definitive Guide to Symfony', True);
     // getting subset
     // Assert
     $this->assertEquals($results, False);
 }
 public function testNonexistentBook()
 {
     $search = new \App\Services\BookSearch($this->books);
     $result = $search->find('The Definitive Guide to Symfony', true);
     $this->assertNull($result);
 }