Example #1
0
 public function testUndoControllerRouteFlashData()
 {
     // Undo a delete without a custom undo route
     $uc = new \App\Http\Controllers\UserController();
     $uc->undoRoute = "restoreRoute";
     $undoFlashData = $uc->deleteModel(3);
     $this->assertTrue(is_array($undoFlashData));
     $this->assertArrayHasKey("undo", $undoFlashData);
     $this->assertArrayHasKey("route", $undoFlashData["undo"]);
     $this->assertArrayHasKey("params", $undoFlashData["undo"]);
     $this->assertTrue(is_array($undoFlashData["undo"]["params"]));
     $this->assertArrayHasKey("lang", $undoFlashData["undo"]);
     $this->assertEquals("restoreRoute", $undoFlashData["undo"]["route"]);
     $this->assertEquals(3, $undoFlashData["undo"]["params"][0]);
     $this->assertEquals("user.undo.message", $undoFlashData["undo"]["lang"]);
 }