Skip to content

Commit

Permalink
Merge pull request cakephp#711 from cakephp/ADmad-patch-1
Browse files Browse the repository at this point in the history
Use new styled braced placeholders in route templates
  • Loading branch information
markstory authored Nov 9, 2019
2 parents 99d5fca + a7eba21 commit c1c2058
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 56 deletions.
2 changes: 1 addition & 1 deletion config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function (RouteBuilder $routes) {
$routes->connect('/', ['action' => 'index']);
$routes->connect('/preview', ['action' => 'email']);
$routes->connect('/preview/*', ['action' => 'email']);
$routes->connect('/sent/:panel/:id', ['action' => 'sent'], ['pass' => ['panel', 'id']]);
$routes->connect('/sent/{panel}/{id}', ['action' => 'sent'], ['pass' => ['panel', 'id']]);
}
);
});
34 changes: 0 additions & 34 deletions tests/TestCase/Middleware/DebugKitMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,40 +202,6 @@ public function testInvokeNoModifyNonHtmlResponse()
$this->assertSame('OK', $body);
}

/**
* Test that requestAction requests are not tracked or modified.
*
* @return void
*/
public function testInvokeNoModifyRequestAction()
{
$request = new ServerRequest([
'url' => '/articles',
'environment' => ['REQUEST_METHOD' => 'GET'],
'params' => ['requested' => true],
]);
$response = new Response([
'statusCode' => 200,
'type' => 'text/html',
'body' => '<body><p>things</p></body>',
]);

$handler = $this->handler();
$handler->expects($this->once())
->method('handle')
->willReturn($response);
$middleware = new DebugKitMiddleware();
$result = $middleware->process($request, $handler);
$this->assertInstanceOf(Response::class, $result, 'Should return a response');

$requests = TableRegistry::get('DebugKit.Requests');
$total = $requests->find()->where(['url' => '/articles'])->count();

$this->assertEquals(0, $total, 'Should not track sub-requests');
$body = (string)$result->getBody();
$this->assertStringNotContainsString('<script', $body);
}

/**
* Test that configuration is correctly passed to the service
*
Expand Down
21 changes: 0 additions & 21 deletions tests/TestCase/ToolbarServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,27 +123,6 @@ public function testInitializePanels()
$this->assertNotEmpty(Log::getConfig('debug_kit_log_panel'), 'Panel attached logger.');
}

/**
* Test that saveData ignores requestAction
*
* @return void
*/
public function testSaveDataIgnoreRequestAction()
{
$request = new Request([
'url' => '/articles',
'params' => ['plugin' => null, 'requested' => 1],
]);
$response = new Response([
'statusCode' => 200,
'type' => 'text/html',
'body' => '<html><title>test</title><body><p>some text</p></body>',
]);

$bar = new ToolbarService($this->events, []);
$this->assertNull($bar->saveData($request, $response));
}

/**
* Test that saveData ignores debugkit paths
*
Expand Down

0 comments on commit c1c2058

Please sign in to comment.