public function testWithMakesPresentable() { $env = new EnvironmentStub(m::mock('Illuminate\\View\\Engines\\EngineResolver'), m::mock('Illuminate\\View\\ViewFinderInterface'), m::mock('Illuminate\\Events\\Dispatcher')); $view = new View($env, m::mock('Illuminate\\View\\Engines\\EngineInterface'), 'test', 'test/path'); $view->with('presenter', new ViewPresentableStub()); $this->assertTrue($view['presenter'] instanceof Presenter); }
public function testWithMakesArrayPresentable() { $factory = new FactoryStub(m::mock('Illuminate\\View\\Engines\\EngineResolver'), m::mock('Illuminate\\View\\ViewFinderInterface'), m::mock('Illuminate\\Events\\Dispatcher'), new Decorator()); $view = new View($factory, m::mock('Illuminate\\View\\Engines\\EngineInterface'), 'test', 'test/path'); $data = array('presenter' => new ViewPresentableStub()); $view->with($data); $this->assertInstanceOf('Robbo\\Presenter\\Presenter', $view['presenter']); }