public function testThatGetCollectionItemsReturnsWhichIsReturnedByTheRepository() { $expected = array(array('id' => 1), array('id' => 1)); $collectionRepositoryMock = Mockery::mock('App\\Repositories\\CollectionRepository'); $collectionRepositoryMock->shouldReceive('getItemsOf')->with('hams')->andReturn($expected); $collectionService = new CollectionService($collectionRepositoryMock); $returned = $collectionService->getCollectionItems('hams'); $this->assertEquals($expected, $returned); }
/** * Remove the specified Collection from storage. * * @param int $id * * @return Response */ public function destroy($id) { $this->service->delete($id); Flash::success('Collection apagado(a) com sucesso.'); return redirect(route('collections.index')); }