Пример #1
0
 public function testFilter()
 {
     $posts = PostRepository::filter(function ($post) {
         return preg_match('/i love dogs/', $post->content);
     });
     $this->assertEquals(1, count($posts));
     $posts = PostRepository::filter(function ($post) {
         return preg_match('/search target/', $post->content);
     });
     $this->assertEquals(2, $posts->count());
 }