original->getData()[$key]; }); TestResponse::macro('assertViewIs', function ($name) { Assert::assertEquals($name, $this->original->name()); }); EloquentCollection::macro('assertContains', function ($value) { Assert::assertTrue($this->contains($value), "Failed asserting that the collection contains the specified value."); }); EloquentCollection::macro('assertNotContains', function ($value) { Assert::assertFalse($this->contains($value), "Failed asserting that the collection does not contain the specified value."); }); EloquentCollection::macro('assertEquals', function ($items) { Assert::assertEquals(count($this), count($items)); $this->zip($items)->each(function ($pair) { list($a, $b) = $pair; Assert::assertTrue($a->is($b)); }); }); } protected function disableExceptionHandling() { $this->app->instance(ExceptionHandler::class, new class extends Handler { public function __construct() {} public function report(Exception $e) {} public function render($request, Exception $e) { throw $e; } }); } protected function from($url) { session()->setPreviousUrl(url($url)); return $this; } }