예제 #1
0
 public function testSearchAlbumReturnsAListOfAlbums()
 {
     $track_list = new ArrayCollection(array(Album::create('id', 'Album 1'), Album::create('id2', 'Album 2')));
     $repository = $this->getMock('Naxhh\\PlayCool\\Domain\\Contract\\AlbumRepository');
     $repository->expects($this->any())->method('getListByName')->will($this->returnValue($track_list));
     $command = new SearchAlbumCommand('Search term');
     $use_case = new SearchAlbumUseCase($repository);
     $album_list = $use_case->handle($command);
     $this->assertCount(2, $album_list);
     $this->assertInstanceOf('Naxhh\\Playcool\\Domain\\Entity\\Album', $album_list->get(1));
 }
예제 #2
0
파일: Search.php 프로젝트: alexgt9/PlayCool
 private function getAlbums($term)
 {
     $use_case = new SearchAlbumUseCase($this->app['repo.album']);
     return $use_case->handle(new SearchAlbumCommand($term));
 }