Posts

Showing posts from December 24, 2018

Testing Laravel View Composers with Mockery

Image
0 I am trying to test my View Composers. Whenever I pass an object to the $view->with('string', $object) , my test fails. This is when I do the test like this: $view ->shouldReceive('with') ->with('favorites', $this->user->favorites(Ad::class)->get()) ->once(); I'm pretty sure this is due to strict checking. So I looked around and saw this issue. However, I can't seem to get it working. The closure return true, but the test fails: MockeryExceptionInvalidCountException : Method with('favorites', < Closure===true >) from Mockery_3_Illuminate_View_View should be called exactly 1 times but called 0 times. Here is my current test public function it_passes_favorites_to_the_view() $this->setUpUser(); // basically sets $this->user to a User object Auth::shouldReceive('user') ->once() ->andReturn($this->user); $composer = new FavoritesComposer(); $view = Mockery::spy(View::class);

Tiruchirapalli Rock Fort

Image
Tiruchirapalli Rock Fort From Wikipedia, the free encyclopedia Jump to navigation Jump to search Tiruchirapalli Rock Fort General information Architectural style Dravidian Town or city Tiruchirappalli Country India Coordinates 10°49′41″N 78°41′49″E  /  10.828°N 78.697°E  / 10.828; 78.697 Coordinates: 10°49′41″N 78°41′49″E  /  10.828°N 78.697°E  / 10.828; 78.697 Construction started Various times since 580 Cost Unknown Owner Archaeological Survey of India, Government of Tamil Nadu Technical details Structural system Indo Saracenic Dravidian Architecture. Design and construction Architect Various (Pallavas, Cholas, Madurai Nayaks) Engineer Unknown Website www.trichyrockfort.tnhrce.in Tiruchirappalli Rockfort is a historic fortification and temple complex built on an ancient rock. It is located in the city of Tiruchirappalli, Tamil Nadu, India. It is constructed on a 83 metres (272 ft) high rock [1] [2] . There are two Hindu temple