tests/TestCase.php
/**
     * As this package does not include layouts.app, it is easier to just mock the whole View part, and concentrate
     * only on the package code in the controller. Would be interested if anyone has a suggestion on better way
     * to test this.
     *
     * @param string $expectedView
     * @param array $viewArgumentTypes
     * @deprecated - not in use. todo: remove
     */
As this package does not include layouts.app, it is easier to just mock the whole View part, and concentrate
only on the package code in the controller. Would be interested if anyone has a suggestion on better way
to test this.

@param string $expectedView
@param array $viewArgumentTypes
@deprecated - not in use. todo: remove
As this package does not include layouts . app it is easier to just mock the whole View part and concentrate only on the package code in the controller . Would be interested if anyone has a suggestion on better way to test this . @param string $expectedView @param array $viewArgumentTypes @deprecated - not in use . todo : remove
protected function mockView(string $expectedView, array $viewArgumentTypes): void
    {
        $mockedReturnedView = $this->mock(\Illuminate\View\View::class);
        $mockedReturnedView->shouldReceive('render');
        $mockedView = View::shouldReceive('share')
            ->once()
            ->shouldReceive('make')
            ->once();
        $mockedView = call_user_func_array([$mockedView, 'with'], array_merge([$expectedView], $viewArgumentTypes));
        $mockedView->andReturn($mockedReturnedView)
            ->shouldReceive('exists')
            ->shouldReceive('replaceNamespace');
    }
protected function mockView ( string $ expectedView , array $ viewArgumentTypes ) : void { $ mockedReturnedView = $ this -> mock ( \ Illuminate \ View \ View :: class ) ; $ mockedReturnedView -> shouldReceive ( 'render' ) ; $ mockedView = View :: shouldReceive ( 'share' ) -> once ( ) -> shouldReceive ( 'make' ) -> once ( ) ; $ mockedView = call_user_func_array ( [ $ mockedView , 'with' ] , array_merge ( [ $ expectedView ] , $ viewArgumentTypes ) ) ; $ mockedView -> andReturn ( $ mockedReturnedView ) -> shouldReceive ( 'exists' ) -> shouldReceive ( 'replaceNamespace' ) ; }
As this package does not include layouts.app, it is easier to just mock the whole View part, and concentrate
 only on the package code in the controller.
As this package does not include layouts . app it is easier to just mock the whole View part and concentrate only on the package code in the controller .
// Mocked view to return: // Mock the main view() calls in controller.