Skip to content
This repository was archived by the owner on Jan 21, 2020. It is now read-only.

Commit b188638

Browse files
committed
Merge pull request #8 from Maks3w/fix-tests-on-windows
Fix tests compatibility with Windows systems
2 parents 752eb5e + c969653 commit b188638

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

test/ZendViewRendererFactoryTest.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,13 @@ public function testConfiguresPaths()
163163
$this->assertPathNamespaceCount(2, 'bar', $paths);
164164
$this->assertPathNamespaceCount(3, null, $paths);
165165

166-
$this->assertPathNamespaceContains(__DIR__ . '/TestAsset/bar/', 'foo', $paths, var_export($paths, 1));
167-
$this->assertPathNamespaceContains(__DIR__ . '/TestAsset/baz/', 'bar', $paths);
168-
$this->assertPathNamespaceContains(__DIR__ . '/TestAsset/bat/', 'bar', $paths);
169-
$this->assertPathNamespaceContains(__DIR__ . '/TestAsset/one/', null, $paths);
170-
$this->assertPathNamespaceContains(__DIR__ . '/TestAsset/two/', null, $paths);
171-
$this->assertPathNamespaceContains(__DIR__ . '/TestAsset/three/', null, $paths);
166+
$dirSlash = DIRECTORY_SEPARATOR;
167+
$this->assertPathNamespaceContains(__DIR__ . '/TestAsset/bar' . $dirSlash, 'foo', $paths, var_export($paths, 1));
168+
$this->assertPathNamespaceContains(__DIR__ . '/TestAsset/baz' . $dirSlash, 'bar', $paths);
169+
$this->assertPathNamespaceContains(__DIR__ . '/TestAsset/bat' . $dirSlash, 'bar', $paths);
170+
$this->assertPathNamespaceContains(__DIR__ . '/TestAsset/one' . $dirSlash, null, $paths);
171+
$this->assertPathNamespaceContains(__DIR__ . '/TestAsset/two' . $dirSlash, null, $paths);
172+
$this->assertPathNamespaceContains(__DIR__ . '/TestAsset/three' . $dirSlash, null, $paths);
172173
}
173174

174175
public function testConfiguresTemplateMap()

test/ZendViewRendererTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ public function testCanAddPathWithEmptyNamespace()
9999
$paths = $renderer->getPaths();
100100
$this->assertInternalType('array', $paths);
101101
$this->assertEquals(1, count($paths));
102-
$this->assertTemplatePath(__DIR__ . '/TestAsset/', $paths[0]);
103-
$this->assertTemplatePathString(__DIR__ . '/TestAsset/', $paths[0]);
102+
$this->assertTemplatePath(__DIR__ . '/TestAsset' . DIRECTORY_SEPARATOR, $paths[0]);
103+
$this->assertTemplatePathString(__DIR__ . '/TestAsset' . DIRECTORY_SEPARATOR, $paths[0]);
104104
$this->assertEmptyTemplatePathNamespace($paths[0]);
105105
}
106106

@@ -111,8 +111,8 @@ public function testCanAddPathWithNamespace()
111111
$paths = $renderer->getPaths();
112112
$this->assertInternalType('array', $paths);
113113
$this->assertEquals(1, count($paths));
114-
$this->assertTemplatePath(__DIR__ . '/TestAsset/', $paths[0]);
115-
$this->assertTemplatePathString(__DIR__ . '/TestAsset/', $paths[0]);
114+
$this->assertTemplatePath(__DIR__ . '/TestAsset' . DIRECTORY_SEPARATOR, $paths[0]);
115+
$this->assertTemplatePathString(__DIR__ . '/TestAsset' . DIRECTORY_SEPARATOR, $paths[0]);
116116
$this->assertTemplatePathNamespace('test', $paths[0]);
117117
}
118118

0 commit comments

Comments
 (0)