Skip to content

Commit

Permalink
Reorganise test project hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Jul 18, 2019
1 parent bca1d67 commit 523e898
Show file tree
Hide file tree
Showing 24 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:

- run: mkdir test/unit/_junit
- run: vendor/bin/phpunit -c test/unit/phpunit.xml --log-junit test/unit/_junit/junit.xml -d memory_limit=512M
- run:

- store_test_results:
path: test/unit/_junit
Expand Down
5 changes: 3 additions & 2 deletions src/FileSystem/DirectoryWalker.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ public function __construct(string $directory) {
public function findParentContaining(string $match):?string {
$path = $this->directory;

while(!$this->pathIsRoot($path)
&& !$this->directoryContains($path, $match)) {
while(strlen($path) > 0
&& (!$this->pathIsRoot($path)
&& !$this->directoryContains($path, $match))) {
$lastSlashPos = strrpos($path, DIRECTORY_SEPARATOR);
$path = substr($path, 0, $lastSlashPos);
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions test/unit/Logic/AutoloaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function testAutoloadFindsCommonPage() {
"..",
"..",
"project",
"CommonAutoloader",
"dynamic-uris",
]);

$autoloader = new Autoloader(
Expand All @@ -35,7 +35,7 @@ public function testAutoloadFindsNestedCommonPage() {
"..",
"..",
"project",
"CommonAutoloader",
"dynamic-uris",
]);

$autoloader = new Autoloader(
Expand All @@ -44,11 +44,11 @@ public function testAutoloadFindsNestedCommonPage() {
);

$autoloader->autoload(
"\\Test\\App\\Page\\subdir\\_CommonPage"
"\\Test\\App\\Page\\dir\\nested\\_CommonPage"
);

self::assertTrue(class_exists(
"\\Test\\App\\Page\\SubDir\\_CommonPage",
"\\Test\\App\\Page\\dir\\nested\\_CommonPage",
false
));
}
Expand Down

0 comments on commit 523e898

Please sign in to comment.