Skip to content

Commit

Permalink
Remove bug in refactoring to resolve issue #49.
Browse files Browse the repository at this point in the history
  • Loading branch information
mageekguy committed Jun 15, 2012
1 parent 2c6ea25 commit 89d3bb2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
22 changes: 11 additions & 11 deletions tests/units/classes/report/fields/runner/coverage/html.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,15 @@ public function testCleanDestinationDirectory()
->then
->object($field->cleanDestinationDirectory())->isIdenticalTo($field)
->adapter($adapter)
->call('unlink')->withArguments(self::uniformizeStream('atoum://destinationDirectory/aDirectory/firstFile'))->once()
->call('unlink')->withArguments(self::uniformizeStream('atoum://destinationDirectory/aDirectory/secondFile'))->once()
->call('rmdir')->withArguments(self::uniformizeStream('atoum://destinationDirectory/aDirectory'))->once()
->call('unlink')->withArguments(self::uniformizeStream('atoum://destinationDirectory/anOtherDirectory/anOtherFirstFile'))->once()
->call('unlink')->withArguments(self::uniformizeStream('atoum://destinationDirectory/anOtherDirectory/anOtherSecondFile'))->once()
->call('rmdir')->withArguments(self::uniformizeStream('atoum://destinationDirectory/anOtherDirectory'))->once()
->call('unlink')->withArguments(self::uniformizeStream('atoum://destinationDirectory/aFile'))->once()
->call('rmdir')->withArguments(self::uniformizeStream('atoum://destinationDirectory/emptyDirectory'))->once()
->call('rmdir')->withArguments(self::uniformizeStream($destinationDirectoryPath))->never()
->call('unlink')->withArguments(self::toOsStream('atoum://destinationDirectory/aDirectory/firstFile'))->once()
->call('unlink')->withArguments(self::toOsStream('atoum://destinationDirectory/aDirectory/secondFile'))->once()
->call('rmdir')->withArguments(self::toOsStream('atoum://destinationDirectory/aDirectory'))->once()
->call('unlink')->withArguments(self::toOsStream('atoum://destinationDirectory/anOtherDirectory/anOtherFirstFile'))->once()
->call('unlink')->withArguments(self::toOsStream('atoum://destinationDirectory/anOtherDirectory/anOtherSecondFile'))->once()
->call('rmdir')->withArguments(self::toOsStream('atoum://destinationDirectory/anOtherDirectory'))->once()
->call('unlink')->withArguments(self::toOsStream('atoum://destinationDirectory/aFile'))->once()
->call('rmdir')->withArguments(self::toOsStream('atoum://destinationDirectory/emptyDirectory'))->once()
->call('rmdir')->withArguments(self::toOsStream($destinationDirectoryPath))->never()
->if($field->getMockController()->getDestinationDirectoryIterator->throw = new \exception())
->then
->object($field->cleanDestinationDirectory())->isIdenticalTo($field)
Expand Down Expand Up @@ -573,9 +573,9 @@ public function test__toString()
;
}

protected static function uniformizeStream($stream)
protected static function toOsStream($stream)
{
return atoum\mock\stream::setDirectorySeparator($stream, '/');
return atoum\mock\stream::setDirectorySeparator($stream, DIRECTORY_SEPARATOR);
}
}

Expand Down
20 changes: 10 additions & 10 deletions tests/units/classes/scripts/builder/vcs/svn.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,21 +382,21 @@ public function testCleanWorkingDirectory()
->when(function() use ($svn) { $svn->setWorkingDirectory('atoum://workingDirectory'); })
->object($svn->cleanWorkingDirectory())->isIdenticalTo($svn)
->adapter($adapter)
->call('unlink')->withArguments(self::toUnixStream('atoum://workingDirectory/aDirectory/firstFile'))->once()
->call('unlink')->withArguments(self::toUnixStream('atoum://workingDirectory/aDirectory/secondFile'))->once()
->call('rmdir')->withArguments(self::toUnixStream('atoum://workingDirectory/aDirectory'))->once()
->call('rmdir')->withArguments(self::toUnixStream('atoum://workingDirectory/emptyDirectory'))->once()
->call('unlink')->withArguments(self::toUnixStream('atoum://workingDirectory/anOtherDirectory/anOtherFirstFile'))->once()
->call('unlink')->withArguments(self::toUnixStream('atoum://workingDirectory/anOtherDirectory/anOtherSecondFile'))->once()
->call('rmdir')->withArguments(self::toUnixStream('atoum://workingDirectory/anOtherDirectory'))->once()
->call('unlink')->withArguments(self::toUnixStream('atoum://workingDirectory/aFile'))->once()
->call('unlink')->withArguments(self::toOsStream('atoum://workingDirectory/aDirectory/firstFile'))->once()
->call('unlink')->withArguments(self::toOsStream('atoum://workingDirectory/aDirectory/secondFile'))->once()
->call('rmdir')->withArguments(self::toOsStream('atoum://workingDirectory/aDirectory'))->once()
->call('rmdir')->withArguments(self::toOsStream('atoum://workingDirectory/emptyDirectory'))->once()
->call('unlink')->withArguments(self::toOsStream('atoum://workingDirectory/anOtherDirectory/anOtherFirstFile'))->once()
->call('unlink')->withArguments(self::toOsStream('atoum://workingDirectory/anOtherDirectory/anOtherSecondFile'))->once()
->call('rmdir')->withArguments(self::toOsStream('atoum://workingDirectory/anOtherDirectory'))->once()
->call('unlink')->withArguments(self::toOsStream('atoum://workingDirectory/aFile'))->once()
->call('rmdir')->withArguments('atoum://workingDirectory')->never()
;
}

protected static function toUnixStream($stream)
protected static function toOsStream($stream)
{
return atoum\mock\stream::setDirectorySeparator($stream, '/');
return atoum\mock\stream::setDirectorySeparator($stream, DIRECTORY_SEPARATOR);
}
}

Expand Down

0 comments on commit 89d3bb2

Please sign in to comment.