Skip to content

Commit 4fe3c91

Browse files
committed
Fix tests
1 parent a9d8e25 commit 4fe3c91

25 files changed

+189
-185
lines changed

tests/Cases/GenericTest.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,23 @@
1010
namespace ItvisionSy\Laravel\Modules\Tests\Cases;
1111

1212
use Config;
13+
use ErrorException;
14+
use Exception;
1315
use ItvisionSy\Laravel\Modules\Modules;
1416
use ItvisionSy\Laravel\Modules\StoreHandlers\DummyStoreHandler;
17+
use ItvisionSy\Laravel\Modules\Tests\ExtendedModules;
1518
use ItvisionSy\Laravel\Modules\Tests\LaravelModulesTestCase;
19+
use stdClass;
1620

1721
class GenericTest extends LaravelModulesTestCase {
1822

1923
public function testFailStaticAccess() {
20-
$this->expectException(\ErrorException::class);
24+
$this->expectException(ErrorException::class);
2125
Modules::invalidMethod();
2226
}
2327

2428
public function testFailedPublicAccess() {
25-
$this->expectException(\ErrorException::class);
29+
$this->expectException(ErrorException::class);
2630
$modules = new Modules();
2731
$modules->invalidMethod();
2832
}
@@ -39,7 +43,7 @@ public function testModulesServiceProvider() {
3943
}
4044

4145
public function testInvalidModulesServiceProvider() {
42-
$this->expectException(\Exception::class);
46+
$this->expectException(Exception::class);
4347
$this->refreshApplication();
4448
Modules::get('InvalidTest');
4549
}
@@ -49,22 +53,22 @@ public function testCallableHandler() {
4953
Config::set('modules.store_handler', function () {
5054
return DummyStoreHandler::make();
5155
});
52-
\ItvisionSy\Laravel\Modules\Tests\ExtendedModules::resetStoreHandler();
56+
ExtendedModules::resetStoreHandler();
5357
$this->assertEquals(DummyStoreHandler::class, get_class(Modules::getStoreHandler()));
5458
}
5559

5660
public function testEmptyHandler() {
5761
$this->refreshApplication();
5862
Config::set('modules.store_handler', false);
59-
\ItvisionSy\Laravel\Modules\Tests\ExtendedModules::resetStoreHandler();
63+
ExtendedModules::resetStoreHandler();
6064
$this->assertEquals(DummyStoreHandler::class, get_class(Modules::getStoreHandler()));
6165
}
6266

6367
public function testInvalidHandlerSet() {
64-
$this->expectException(\ErrorException::class);
68+
$this->expectException(ErrorException::class);
6569
$this->refreshApplication();
66-
Config::set('modules.store_handler', new \stdClass());
67-
\ItvisionSy\Laravel\Modules\Tests\ExtendedModules::resetStoreHandler();
70+
Config::set('modules.store_handler', new stdClass());
71+
ExtendedModules::resetStoreHandler();
6872
Modules::getStoreHandler();
6973
}
7074

@@ -78,7 +82,7 @@ public function testDeletedModuleFiles() {
7882
Modules::refreshModules();
7983
try {
8084
Modules::get('Test2');
81-
} catch (\Exception $e) {
85+
} catch (Exception $e) {
8286
$this->assertEquals("Module not found: Test2", $e->getMessage());
8387
}
8488

@@ -87,19 +91,15 @@ public function testDeletedModuleFiles() {
8791
Modules::refreshModules();
8892
try {
8993
Modules::get('Test2');
90-
} catch (\Exception $e) {
94+
} catch (Exception $e) {
9195
$this->assertEquals("Module not found: Test2", $e->getMessage());
9296
}
9397

9498
//incorrect module class inheritence
95-
$this->expectException(\Exception::class);
99+
$this->expectException(Exception::class);
96100
file_put_contents(rtrim(Modules::modulesDirectory(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . "Test2" . DIRECTORY_SEPARATOR . "Module.php", "<?php namespace App\\Modules\\Test2; class Module { }");
97101
Modules::refreshModules();
98-
try {
99-
Modules::get('Test2');
100-
} catch (\Exception $e) {
101-
$this->assertEquals("Module not found: Test2", $e->getMessage());
102-
}
102+
Modules::get('Test2');
103103
}
104104

105105
}

tests/codeCoverage/Commands/InitiateDatabaseTable.php.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ <h4>Legend</h4>
199199
<span class="warning"><strong>Dead Code</strong></span>
200200
</p>
201201
<p>
202-
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage 4.0.7</a> using <a href="https://secure.php.net/" target="_top">PHP 5.6.29</a> with <a href="https://xdebug.org/">Xdebug 2.2.5</a> and <a href="https://phpunit.de/">PHPUnit 5.7.16</a> at Sun Apr 2 9:03:25 UTC 2017.</small>
202+
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage 4.0.7</a> using <a href="https://secure.php.net/" target="_top">PHP 5.6.29</a> with <a href="https://xdebug.org/">Xdebug 2.2.5</a> and <a href="https://phpunit.de/">PHPUnit 5.7.16</a> at Sun Apr 2 11:13:33 UTC 2017.</small>
203203
</p>
204204
<a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a>
205205
</footer>

tests/codeCoverage/Commands/MakeModule.php.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ <h4>Legend</h4>
306306
<span class="warning"><strong>Dead Code</strong></span>
307307
</p>
308308
<p>
309-
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage 4.0.7</a> using <a href="https://secure.php.net/" target="_top">PHP 5.6.29</a> with <a href="https://xdebug.org/">Xdebug 2.2.5</a> and <a href="https://phpunit.de/">PHPUnit 5.7.16</a> at Sun Apr 2 9:03:25 UTC 2017.</small>
309+
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage 4.0.7</a> using <a href="https://secure.php.net/" target="_top">PHP 5.6.29</a> with <a href="https://xdebug.org/">Xdebug 2.2.5</a> and <a href="https://phpunit.de/">PHPUnit 5.7.16</a> at Sun Apr 2 11:13:33 UTC 2017.</small>
310310
</p>
311311
<a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a>
312312
</footer>

tests/codeCoverage/Commands/dashboard.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ <h3>Project Risks</h3>
141141
<footer>
142142
<hr/>
143143
<p>
144-
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage 4.0.7</a> using <a href="https://secure.php.net/" target="_top">PHP 5.6.29</a> with <a href="https://xdebug.org/">Xdebug 2.2.5</a> and <a href="https://phpunit.de/">PHPUnit 5.7.16</a> at Sun Apr 2 9:03:25 UTC 2017.</small>
144+
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage 4.0.7</a> using <a href="https://secure.php.net/" target="_top">PHP 5.6.29</a> with <a href="https://xdebug.org/">Xdebug 2.2.5</a> and <a href="https://phpunit.de/">PHPUnit 5.7.16</a> at Sun Apr 2 11:13:33 UTC 2017.</small>
145145
</p>
146146
</footer>
147147
</div>

tests/codeCoverage/Commands/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ <h4>Legend</h4>
137137
<span class="success"><strong>High</strong>: 90% to 100%</span>
138138
</p>
139139
<p>
140-
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage 4.0.7</a> using <a href="https://secure.php.net/" target="_top">PHP 5.6.29</a> with <a href="https://xdebug.org/">Xdebug 2.2.5</a> and <a href="https://phpunit.de/">PHPUnit 5.7.16</a> at Sun Apr 2 9:03:25 UTC 2017.</small>
140+
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage 4.0.7</a> using <a href="https://secure.php.net/" target="_top">PHP 5.6.29</a> with <a href="https://xdebug.org/">Xdebug 2.2.5</a> and <a href="https://phpunit.de/">PHPUnit 5.7.16</a> at Sun Apr 2 11:13:33 UTC 2017.</small>
141141
</p>
142142
</footer>
143143
</div>

tests/codeCoverage/Controller.php.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ <h4>Legend</h4>
210210
<span class="warning"><strong>Dead Code</strong></span>
211211
</p>
212212
<p>
213-
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage 4.0.7</a> using <a href="https://secure.php.net/" target="_top">PHP 5.6.29</a> with <a href="https://xdebug.org/">Xdebug 2.2.5</a> and <a href="https://phpunit.de/">PHPUnit 5.7.16</a> at Sun Apr 2 9:03:25 UTC 2017.</small>
213+
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage 4.0.7</a> using <a href="https://secure.php.net/" target="_top">PHP 5.6.29</a> with <a href="https://xdebug.org/">Xdebug 2.2.5</a> and <a href="https://phpunit.de/">PHPUnit 5.7.16</a> at Sun Apr 2 11:13:33 UTC 2017.</small>
214214
</p>
215215
<a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a>
216216
</footer>

tests/codeCoverage/Interfaces/KeyValueStoreInterface.php.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ <h4>Legend</h4>
9090
<span class="warning"><strong>Dead Code</strong></span>
9191
</p>
9292
<p>
93-
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage 4.0.7</a> using <a href="https://secure.php.net/" target="_top">PHP 5.6.29</a> with <a href="https://xdebug.org/">Xdebug 2.2.5</a> and <a href="https://phpunit.de/">PHPUnit 5.7.16</a> at Sun Apr 2 9:03:25 UTC 2017.</small>
93+
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage 4.0.7</a> using <a href="https://secure.php.net/" target="_top">PHP 5.6.29</a> with <a href="https://xdebug.org/">Xdebug 2.2.5</a> and <a href="https://phpunit.de/">PHPUnit 5.7.16</a> at Sun Apr 2 11:13:33 UTC 2017.</small>
9494
</p>
9595
<a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a>
9696
</footer>

tests/codeCoverage/Interfaces/StaticAndInstanceAccessInterface.php.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ <h4>Legend</h4>
9393
<span class="warning"><strong>Dead Code</strong></span>
9494
</p>
9595
<p>
96-
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage 4.0.7</a> using <a href="https://secure.php.net/" target="_top">PHP 5.6.29</a> with <a href="https://xdebug.org/">Xdebug 2.2.5</a> and <a href="https://phpunit.de/">PHPUnit 5.7.16</a> at Sun Apr 2 9:03:25 UTC 2017.</small>
96+
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage 4.0.7</a> using <a href="https://secure.php.net/" target="_top">PHP 5.6.29</a> with <a href="https://xdebug.org/">Xdebug 2.2.5</a> and <a href="https://phpunit.de/">PHPUnit 5.7.16</a> at Sun Apr 2 11:13:33 UTC 2017.</small>
9797
</p>
9898
<a title="Back to the top" id="toplink" href="#"><span class="glyphicon glyphicon-arrow-up"></span></a>
9999
</footer>

tests/codeCoverage/Interfaces/dashboard.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ <h3>Project Risks</h3>
137137
<footer>
138138
<hr/>
139139
<p>
140-
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage 4.0.7</a> using <a href="https://secure.php.net/" target="_top">PHP 5.6.29</a> with <a href="https://xdebug.org/">Xdebug 2.2.5</a> and <a href="https://phpunit.de/">PHPUnit 5.7.16</a> at Sun Apr 2 9:03:25 UTC 2017.</small>
140+
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage 4.0.7</a> using <a href="https://secure.php.net/" target="_top">PHP 5.6.29</a> with <a href="https://xdebug.org/">Xdebug 2.2.5</a> and <a href="https://phpunit.de/">PHPUnit 5.7.16</a> at Sun Apr 2 11:13:33 UTC 2017.</small>
141141
</p>
142142
</footer>
143143
</div>

tests/codeCoverage/Interfaces/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ <h4>Legend</h4>
9292
<span class="success"><strong>High</strong>: 90% to 100%</span>
9393
</p>
9494
<p>
95-
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage 4.0.7</a> using <a href="https://secure.php.net/" target="_top">PHP 5.6.29</a> with <a href="https://xdebug.org/">Xdebug 2.2.5</a> and <a href="https://phpunit.de/">PHPUnit 5.7.16</a> at Sun Apr 2 9:03:25 UTC 2017.</small>
95+
<small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage 4.0.7</a> using <a href="https://secure.php.net/" target="_top">PHP 5.6.29</a> with <a href="https://xdebug.org/">Xdebug 2.2.5</a> and <a href="https://phpunit.de/">PHPUnit 5.7.16</a> at Sun Apr 2 11:13:33 UTC 2017.</small>
9696
</p>
9797
</footer>
9898
</div>

0 commit comments

Comments
 (0)