Skip to content

Commit

Permalink
Fixing test which has strange bug causing false fails on ScrutinzerCI…
Browse files Browse the repository at this point in the history
… but not on TravisCI.
  • Loading branch information
Luke Watts committed May 19, 2017
1 parent cf90e31 commit e370f2c
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions tests/FileTest.php
Expand Up @@ -300,20 +300,19 @@ public function testSetFileListUsingPatternWithRegex()
$this->assertContainsOnlyInstancesOf('SplFileInfo', $this->file->getFileList());
$this->assertCount(3, $this->file->getFileList());

$this->assertEquals(
'tests/files/01/02/test02-01.txt',
str_replace(DIRECTORY_SEPARATOR, '/', $this->file->getFileList()[0]->getPathName())
);
$pathnames = [
str_replace(DIRECTORY_SEPARATOR, '/', $this->file->getFileList()[0]->getPathName()),
str_replace(DIRECTORY_SEPARATOR, '/', $this->file->getFileList()[1]->getPathName()),
str_replace(DIRECTORY_SEPARATOR, '/', $this->file->getFileList()[2]->getPathName())
];

$this->assertEquals(
$expected = [
'tests/files/01/02/test02-01.txt',
'tests/files/01/02/test02-02.txt',
str_replace(DIRECTORY_SEPARATOR, '/', $this->file->getFileList()[1]->getPathName())
);

$this->assertEquals(
'tests/files/01/02/test02-03.txt',
str_replace(DIRECTORY_SEPARATOR, '/', $this->file->getFileList()[2]->getPathName())
);
];

$this->assertArraySubset($expected, $pathnames);
}

/**
Expand Down

0 comments on commit e370f2c

Please sign in to comment.