/** * Should use the update route with an ID for an existing resource. */ public function testPersistActionForExistingResource() { $existingCrud = $this->makeMockCrudResource(); $existingCrud->shouldReceive('isStored')->andReturn(true); $routePath = $this->generator()->anyString(); $existingCrud->shouldReceive('routePath')->andReturn($routePath); $crudID = $this->generator()->anyInteger(); $existingCrud->shouldReceive('crudId')->andReturn($crudID); $URL = $this->generator()->anyString(); $this->urlGenerator->shouldReceive('route')->with("{$routePath}.update", $crudID)->andReturn($URL); $this->assertSame($URL, $this->locationComposer->persistActionFor($existingCrud)); }