Skip to content

Commit b557b66

Browse files
committed
Test enhancement about class loading and assertion
1 parent db0b8d8 commit b557b66

3 files changed

Lines changed: 13 additions & 16 deletions

File tree

phpunit.xml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
processIsolation="false"
1010
stopOnFailure="false"
1111
syntaxCheck="false"
12-
bootstrap="tests/bootstrap.php"
12+
bootstrap="vendor/autoload.php"
1313
>
1414
<testsuites>
1515
<testsuite name="All Tests">
1616
<directory>tests/TestCase</directory>
1717
</testsuite>
1818
</testsuites>
1919

20-
</phpunit>
20+
</phpunit>

tests/TestCase/Installer/PluginInstallerTest.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
2-
namespace Cake\Test\TestCase\Composer\Installer;
2+
3+
namespace Cake\Test\Composer\TestCase\Installer;
34

45
use Cake\Test\Composer\Installer\PluginInstaller;
56
use Composer\Composer;
@@ -36,7 +37,7 @@ class PluginInstallerTest extends TestCase
3637
*
3738
* @return void
3839
*/
39-
public function setUp()
40+
protected function setUp()
4041
{
4142
parent::setUp();
4243
$this->package = new Package('CamelCased', '1.0', '1.0');
@@ -67,7 +68,7 @@ public function setUp()
6768
$this->installer = new PluginInstaller($this->io, $composer);
6869
}
6970

70-
public function tearDown()
71+
protected function tearDown()
7172
{
7273
parent::tearDown();
7374
$dirs = array_reverse($this->testDirs);
@@ -112,7 +113,7 @@ public function testPrimaryNamespace()
112113
$this->package->setAutoload($autoload);
113114

114115
$ns = PluginInstaller::primaryNamespace($this->package);
115-
$this->assertEquals('FOC\Authenticate', $ns);
116+
$this->assertSame('FOC\Authenticate', $ns);
116117

117118
$autoload = [
118119
'psr-4' => [
@@ -122,7 +123,7 @@ public function testPrimaryNamespace()
122123
];
123124
$this->package->setAutoload($autoload);
124125
$ns = PluginInstaller::primaryNamespace($this->package);
125-
$this->assertEquals('FOC\Acl', $ns);
126+
$this->assertSame('FOC\Acl', $ns);
126127

127128
$autoload = [
128129
'psr-4' => [
@@ -132,7 +133,7 @@ public function testPrimaryNamespace()
132133
];
133134
$this->package->setAutoload($autoload);
134135
$ns = PluginInstaller::primaryNamespace($this->package);
135-
$this->assertEquals('Acme\Plugin', $ns);
136+
$this->assertSame('Acme\Plugin', $ns);
136137

137138
$autoload = [
138139
'psr-4' => [
@@ -142,7 +143,7 @@ public function testPrimaryNamespace()
142143
];
143144
$this->package->setAutoload($autoload);
144145
$ns = PluginInstaller::primaryNamespace($this->package);
145-
$this->assertEquals('Foo', $ns);
146+
$this->assertSame('Foo', $ns);
146147

147148
$autoload = [
148149
'psr-4' => [
@@ -152,7 +153,7 @@ public function testPrimaryNamespace()
152153
];
153154
$this->package->setAutoload($autoload);
154155
$ns = PluginInstaller::primaryNamespace($this->package);
155-
$this->assertEquals('Foo', $ns);
156+
$this->assertSame('Foo', $ns);
156157

157158
$autoload = [
158159
'psr-4' => [
@@ -162,7 +163,7 @@ public function testPrimaryNamespace()
162163
];
163164
$this->package->setAutoload($autoload);
164165
$ns = PluginInstaller::primaryNamespace($this->package);
165-
$this->assertEquals('Acme\Foo', $ns);
166+
$this->assertSame('Acme\Foo', $ns);
166167

167168
$autoload = [
168169
'psr-4' => [
@@ -172,7 +173,7 @@ public function testPrimaryNamespace()
172173
];
173174
$this->package->setAutoload($autoload);
174175
$name = PluginInstaller::primaryNamespace($this->package);
175-
$this->assertEquals('Acme\Foo', $name);
176+
$this->assertSame('Acme\Foo', $name);
176177
}
177178

178179
public function testDeterminePlugins()

tests/bootstrap.php

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)