Skip to content
This repository was archived by the owner on Jan 18, 2018. It is now read-only.

Commit cfeddee

Browse files
Testing improvements
1 parent c4efc8f commit cfeddee

5 files changed

Lines changed: 24 additions & 23 deletions

File tree

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/.gitattributes export-ignore
55
/.gitignore export-ignore
66
/.travis.yml export-ignore
7-
/phpunit.xml export-ignore
7+
/phpunit.xml.dist export-ignore
88
/CHANGELOG.md export-ignore
99
/CONTRIBUTING.md export-ignore
1010
/README.md export-ignore

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
/.idea
12
/vendor
23
composer.lock
4+
phpunit.xml

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ php:
88

99
before_script:
1010
- travis_retry composer self-update
11-
- travis_retry composer install --no-interaction --prefer-source --dev
11+
- travis_retry composer install --no-interaction --prefer-source
1212

1313
script:
14-
- bash -c 'if [ "$TRAVIS_PHP_VERSION" == "hhvm" ]; then vendor/bin/phpunit --verbose; fi;'
15-
- bash -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then vendor/bin/phpunit --verbose --coverage-clover build/logs/clover.xml; fi;'
14+
- bash -c 'if [ "$TRAVIS_PHP_VERSION" == "hhvm" ]; then vendor/bin/phpunit; fi;'
15+
- bash -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then vendor/bin/phpunit --coverage-clover build/logs/clover.xml; fi;'
1616

1717
after_success:
1818
- bash -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi;'

phpunit.xml renamed to phpunit.xml.dist

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,22 @@
77
convertNoticesToExceptions="true"
88
convertWarningsToExceptions="true"
99
processIsolation="false"
10+
stopOnError="false"
1011
stopOnFailure="false"
1112
syntaxCheck="true"
13+
strict="true"
14+
verbose="true">
1215
>
1316
<testsuites>
14-
<testsuite name="Package Test Suite">
15-
<directory suffix=".php">./tests</directory>
17+
<testsuite name="Laravel Navigation Test Suite">
18+
<directory suffix="Test.php">./tests</directory>
1619
</testsuite>
1720
</testsuites>
1821
<filter>
19-
<whitelist addUncoveredFilesFromWhitelist="true">
22+
<whitelist processUncoveredFilesFromWhitelist="true">
2023
<directory suffix=".php">./src</directory>
2124
<exclude>
2225
<directory>./src/config</directory>
23-
<directory>./src/migrations</directory>
24-
<directory>./src/views</directory>
25-
<directory>./tests</directory>
26-
<directory>./vendor</directory>
2726
</exclude>
2827
</whitelist>
2928
</filter>

tests/NavigationTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function testMainDefault()
5656
array('title' => 'Laravel', 'url' => 'http://laravel.com/url', 'active' => false)
5757
);
5858

59-
$this->assertEquals($expected, $return);
59+
$this->assertSame($expected, $return);
6060
}
6161

6262
public function testMainOther()
@@ -84,7 +84,7 @@ public function testMainOther()
8484
array('title' => 'Laravel', 'url' => 'http://laravel.com/url', 'active' => false)
8585
);
8686

87-
$this->assertEquals($expected, $return);
87+
$this->assertSame($expected, $return);
8888
}
8989

9090
public function testMainEmpty()
@@ -98,7 +98,7 @@ public function testMainEmpty()
9898

9999
$expected = array();
100100

101-
$this->assertEquals($expected, $return);
101+
$this->assertSame($expected, $return);
102102
}
103103

104104
public function testBarDefault()
@@ -123,7 +123,7 @@ public function testBarDefault()
123123
array('title' => 'Laravel', 'url' => 'http://laravel.com/url')
124124
);
125125

126-
$this->assertEquals($expected, $return);
126+
$this->assertSame($expected, $return);
127127
}
128128

129129
public function testBarOther()
@@ -148,7 +148,7 @@ public function testBarOther()
148148
array('title' => 'Laravel', 'url' => 'http://laravel.com/url')
149149
);
150150

151-
$this->assertEquals($expected, $return);
151+
$this->assertSame($expected, $return);
152152
}
153153

154154
public function testBarEmpty()
@@ -162,7 +162,7 @@ public function testBarEmpty()
162162

163163
$expected = array();
164164

165-
$this->assertEquals($expected, $return);
165+
$this->assertSame($expected, $return);
166166
}
167167

168168
public function testAddToMain()
@@ -171,7 +171,7 @@ public function testAddToMain()
171171

172172
$return = $navigation->addToMain(array('title' => 'Test', 'slug' => 'test'));
173173

174-
$this->assertEquals($navigation, $return);
174+
$this->assertSame($navigation, $return);
175175
}
176176

177177
public function testAddToBar()
@@ -180,7 +180,7 @@ public function testAddToBar()
180180

181181
$return = $navigation->addToBar(array('title' => 'Test', 'slug' => 'test'));
182182

183-
$this->assertEquals($navigation, $return);
183+
$this->assertSame($navigation, $return);
184184
}
185185

186186
public function testGetHTMLNoBar()
@@ -203,7 +203,7 @@ public function testGetHTMLNoBar()
203203

204204
$return = $navigation->render('default', false);
205205

206-
$this->assertEquals($return, 'html goes here');
206+
$this->assertSame('html goes here', $return);
207207
}
208208

209209
public function testGetHTMLEmptyBar()
@@ -228,7 +228,7 @@ public function testGetHTMLEmptyBar()
228228

229229
$return = $navigation->render('default', 'default');
230230

231-
$this->assertEquals($return, 'html goes here');
231+
$this->assertSame('html goes here', $return);
232232
}
233233

234234
public function testGetHTMLWithBar()
@@ -254,7 +254,7 @@ public function testGetHTMLWithBar()
254254

255255
$return = $navigation->render('default', 'default');
256256

257-
$this->assertEquals($return, 'html goes here');
257+
$this->assertSame('html goes here', $return);
258258
}
259259

260260
public function testSetRequest()
@@ -267,7 +267,7 @@ public function testSetRequest()
267267

268268
$return = $navigation->getRequest();
269269

270-
$this->assertEquals($request, $return);
270+
$this->assertSame($request, $return);
271271
}
272272

273273
protected function getNavigation()

0 commit comments

Comments
 (0)