Skip to content

Commit 4daa5a2

Browse files
Fixed some tests on Windows (#168)
Co-authored-by: Bruce Wells <[email protected]>
1 parent 169a1d2 commit 4daa5a2

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

tests/Gitonomy/Git/Tests/AbstractTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
abstract class AbstractTest extends TestCase
2020
{
21-
const REPOSITORY_URL = 'http://github.com/gitonomy/foobar.git';
21+
const REPOSITORY_URL = 'https://github.com/gitonomy/foobar.git';
2222

2323
const LONGFILE_COMMIT = '4f17752acc9b7c54ba679291bf24cb7d354f0f4f';
2424
const BEFORE_LONGFILE_COMMIT = 'e0ec50e2af75fa35485513f60b2e658e245227e9';

tests/Gitonomy/Git/Tests/CommitTest.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,8 @@ public function testGetShortMessage($repository)
227227
public function testGetBodyMessage($repository)
228228
{
229229
$commit = $repository->getCommit(self::LONGMESSAGE_COMMIT);
230-
$message = <<<'EOL'
231-
If you want to know everything,
232-
I ran something like `chmox +x test.sh`
233-
234-
Hello and good bye.
235-
236-
EOL;
237-
230+
$nl = chr(10);
231+
$message = "If you want to know everything,{$nl}I ran something like `chmox +x test.sh`{$nl}{$nl}Hello and good bye.{$nl}";
238232
$this->assertEquals($message, $commit->getBodyMessage());
239233

240234
$commit = $repository->getCommit(self::INITIAL_COMMIT);

tests/Gitonomy/Git/Tests/HooksTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function testSymlink($repository)
104104
$repository->getHooks()->setSymlink('foo', $file);
105105

106106
$this->assertTrue(is_link($this->hookPath($repository, 'foo')), 'foo hook is a symlink');
107-
$this->assertEquals($file, readlink($this->hookPath($repository, 'foo')), 'target of symlink is correct');
107+
$this->assertEquals(str_replace('\\', '/', $file), str_replace('\\', '/', readlink($this->hookPath($repository, 'foo'))), 'target of symlink is correct');
108108
}
109109

110110
/**

0 commit comments

Comments
 (0)