Skip to content

Commit f4b4a72

Browse files
authored
Merge branch 'master' into master-dashboard
2 parents 946075d + 5de7f3b commit f4b4a72

File tree

16 files changed

+43
-52
lines changed

16 files changed

+43
-52
lines changed

.travis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ language: php
33
php:
44
- 5.6
55
- 7.0
6-
- 7.1
7-
- 7.2
86
- 7.3
9-
10-
sudo: false
7+
- 7.4snapshot
118

129
services:
1310
- postgresql
@@ -26,20 +23,23 @@ matrix:
2623
include:
2724
- php: 7.1
2825
env: PHPCS=1
26+
2927
- php: 7.1
3028
env: CODECOVERAGE=1 DEFAULT=0
29+
3130
- php: 5.6
3231
env: PREFER_LOWEST=1
3332

33+
allow_failures:
34+
- php: 7.4snapshot
35+
3436
install:
3537
- sh -c "if [ '$PREFER_LOWEST' != '1' ]; then composer install --prefer-dist --no-interaction; fi"
3638
- sh -c "if [ '$PREFER_LOWEST' = '1' ]; then composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable; fi"
3739

3840
before_script:
3941
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi"
4042
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi"
41-
- phpenv rehash
42-
- set +H
4343

4444
script:
4545
- sh -c "if [ '$DEFAULT' = '1' ]; then [ "$(find . \( -path './vendor' \) -prune -o -type f \( -name '*.ctp' -o -name '*.php' \) -print0 | xargs -0 --no-run-if-empty -L1 -i'{}' php -l '{}' | grep -vc 'No syntax errors')" -eq 0 ]; fi"

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"authors": [
99
{
1010
"name": "Mark Story",
11-
"homepage": "http://mark-story.com",
11+
"homepage": "https://mark-story.com",
1212
"role": "Author"
1313
},
1414
{
@@ -36,8 +36,8 @@
3636
},
3737
"autoload": {
3838
"psr-4": {
39-
"DebugKit\\": "src",
40-
"DebugKit\\Test\\Fixture\\": "tests\\Fixture"
39+
"DebugKit\\": "src/",
40+
"DebugKit\\Test\\Fixture\\": "tests/Fixture/"
4141
}
4242
},
4343
"autoload-dev": {

phpunit.xml.dist

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,29 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit
3-
colors="true"
4-
processIsolation="false"
5-
stopOnFailure="false"
6-
syntaxCheck="false"
7-
bootstrap="./tests/bootstrap.php"
8-
>
2+
<phpunit bootstrap="tests/bootstrap.php">
93
<php>
104
<ini name="memory_limit" value="-1"/>
115
</php>
126

137
<!-- Add any additional test suites you want to run here -->
148
<testsuites>
15-
<testsuite name="All Tests">
16-
<directory>./tests/TestCase</directory>
9+
<testsuite name="debug-kit">
10+
<directory>tests/TestCase</directory>
1711
</testsuite>
1812
<!-- Add plugin test suites here. -->
1913
</testsuites>
2014

2115
<!-- configure code coverage -->
2216
<filter>
2317
<whitelist>
24-
<directory suffix=".php">./src/</directory>
18+
<directory suffix=".php">src/</directory>
2519
</whitelist>
2620
</filter>
2721

2822
<!-- Setup a listener for fixtures -->
2923
<listeners>
30-
<listener
31-
class="\Cake\TestSuite\Fixture\FixtureInjector"
32-
file="./vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureInjector.php">
24+
<listener class="Cake\TestSuite\Fixture\FixtureInjector">
3325
<arguments>
34-
<object class="\Cake\TestSuite\Fixture\FixtureManager" />
26+
<object class="Cake\TestSuite\Fixture\FixtureManager"/>
3527
</arguments>
3628
</listener>
3729
</listeners>

src/Panel/RequestPanel.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
*/
2323
class RequestPanel extends DebugPanel
2424
{
25-
2625
/**
2726
* Data collection callback.
2827
*
@@ -31,7 +30,7 @@ class RequestPanel extends DebugPanel
3130
*/
3231
public function shutdown(Event $event)
3332
{
34-
/* @var Controller $controller */
33+
/* @var \Cake\Controller\Controller $controller */
3534
$controller = $event->getSubject();
3635
$request = $controller->request;
3736
$this->_data = [

src/Panel/RoutesPanel.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,20 @@ class RoutesPanel extends DebugPanel
2727
/**
2828
* Get summary data for the routes panel.
2929
*
30-
* @return int
30+
* @return string
3131
*/
3232
public function summary()
3333
{
3434
$appClass = Configure::read('App.namespace') . '\Application';
3535
if (class_exists($appClass, false) && !Router::$initialized) {
36-
return 0;
36+
return '0';
3737
}
3838

3939
$routes = array_filter(Router::routes(), function ($route) {
4040
return (!isset($routes->defaults['plugin'])) || $route->defaults['plugin'] !== 'DebugKit';
4141
});
4242

43-
return count($routes);
43+
return (string)count($routes);
4444
}
4545

4646
/**

tests/TestCase/Cache/Engine/DebugEngineTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ public function testProxyMethodsTracksMetrics()
104104
$this->engine->decrement('key');
105105

106106
$result = $this->engine->metrics();
107-
$this->assertEquals(3, $result['write']);
108-
$this->assertEquals(1, $result['delete']);
109-
$this->assertEquals(1, $result['read']);
107+
$this->assertSame(3, $result['write']);
108+
$this->assertSame(1, $result['delete']);
109+
$this->assertSame(1, $result['read']);
110110
}
111111

112112
/**

tests/TestCase/Controller/ToolbarControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ public function setUp()
5353
public function testClearCacheNoGet()
5454
{
5555
$this->get('/debug-kit/toolbar/clear_cache?name=testing');
56+
$this->assertResponseCode(404);
5657

57-
$this->assertEquals(404, $this->_response->getStatusCode());
5858
}
5959

6060
/**

tests/TestCase/Database/Log/DebugLogTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ public function testLog()
5353

5454
$this->logger->log($query);
5555
$this->assertCount(1, $this->logger->queries());
56-
$this->assertEquals(10, $this->logger->totalTime());
57-
$this->assertEquals(5, $this->logger->totalRows());
56+
$this->assertSame(10, $this->logger->totalTime());
57+
$this->assertSame(5, $this->logger->totalRows());
5858

5959
$this->logger->log($query);
6060
$this->assertCount(2, $this->logger->queries());
61-
$this->assertEquals(20, $this->logger->totalTime());
62-
$this->assertEquals(10, $this->logger->totalRows());
61+
$this->assertSame(20, $this->logger->totalTime());
62+
$this->assertSame(10, $this->logger->totalRows());
6363
}
6464

6565
/**

tests/TestCase/DebugTimerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function testNestedAnonymousTimers()
9999
$this->assertTrue(DebugTimer::stop());
100100

101101
$timers = DebugTimer::getAll();
102-
$this->assertEquals(3, count($timers), 'incorrect number of timers %s');
102+
$this->assertSame(3, count($timers), 'incorrect number of timers %s');
103103
$firstTimerLine = __LINE__ - 9;
104104
$secondTimerLine = __LINE__ - 8;
105105
$file = Debugger::trimPath(__FILE__);
@@ -129,7 +129,7 @@ public function testRepeatTimers()
129129
DebugTimer::stop('my timer');
130130

131131
$timers = DebugTimer::getAll();
132-
$this->assertEquals(3, count($timers), 'wrong timer count %s');
132+
$this->assertSame(3, count($timers), 'wrong timer count %s');
133133

134134
$this->assertTrue(isset($timers['my timer']));
135135
$this->assertTrue(isset($timers['my timer #2']));

tests/TestCase/Middleware/DebugKitMiddlewareTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function testInvokeSaveData()
101101
$this->assertEquals('/articles', $result->url);
102102
$this->assertNotEmpty($result->requested_at);
103103
$this->assertNotEmpty('text/html', $result->content_type);
104-
$this->assertEquals(200, $result->status_code);
104+
$this->assertSame(200, $result->status_code);
105105
$this->assertGreaterThan(1, $result->panels);
106106

107107
$this->assertEquals('SqlLog', $result->panels[11]->panel);
@@ -149,7 +149,7 @@ public function testInvokeNoModifyBinaryResponse()
149149
$requests = TableRegistry::get('DebugKit.Requests');
150150
$total = $requests->find()->where(['url' => '/articles'])->count();
151151

152-
$this->assertEquals(1, $total, 'Should track response');
152+
$this->assertSame(1, $total, 'Should track response');
153153
$body = $result->getBody();
154154
$this->assertNotContains('__debug_kit', '' . $body);
155155
$this->assertNotContains('<script', '' . $body);
@@ -182,7 +182,7 @@ public function testInvokeNoModifyNonHtmlResponse()
182182
$requests = TableRegistry::get('DebugKit.Requests');
183183
$total = $requests->find()->where(['url' => '/articles'])->count();
184184

185-
$this->assertEquals(1, $total, 'Should track response');
185+
$this->assertSame(1, $total, 'Should track response');
186186
$body = $result->getBody();
187187
$this->assertSame('OK', '' . $body);
188188
}
@@ -215,7 +215,7 @@ public function testInvokeNoModifyRequestAction()
215215
$requests = TableRegistry::get('DebugKit.Requests');
216216
$total = $requests->find()->where(['url' => '/articles'])->count();
217217

218-
$this->assertEquals(0, $total, 'Should not track sub-requests');
218+
$this->assertSame(0, $total, 'Should not track sub-requests');
219219
$body = $result->getBody();
220220
$this->assertNotContains('<script', '' . $body);
221221
}

0 commit comments

Comments
 (0)