-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed tests and lint problems in windows #515
Changes from 4 commits
8b574d4
9cd5b9d
dc5f1a9
7ac12b7
147c424
9251a6d
193cf9b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
<?php | ||
|
||
use flight\template\View; | ||
|
||
/** | ||
* Flight: An extensible micro-framework. | ||
* | ||
|
@@ -65,7 +68,7 @@ public function testRender() | |
|
||
public function testRenderBadFilePath() { | ||
$this->expectException(Exception::class); | ||
$this->expectExceptionMessage('Template file not found: '.__DIR__ . '/views/badfile.php'); | ||
$this->expectExceptionMessage('Template file not found: ' . __DIR__ . DIRECTORY_SEPARATOR . 'views'. DIRECTORY_SEPARATOR . 'badfile.php'); | ||
|
||
$this->view->render('badfile'); | ||
} | ||
|
@@ -117,4 +120,27 @@ public function testENoNeedToEscape() { | |
$result = $this->view->e('script'); | ||
$this->assertEquals('script', $result); | ||
} | ||
|
||
public function testNormalizePath(): void | ||
{ | ||
$viewMock = new class extends View { | ||
public static function normalizePath(string $path, string $separator = DIRECTORY_SEPARATOR): string | ||
{ | ||
return parent::normalizePath($path, $separator); | ||
} | ||
}; | ||
|
||
self::assertSame( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a huge deal but the rest of the file uses There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh sorry, I hadn't noticed |
||
'C:/xampp/htdocs/libs/Flight/core/index.php', | ||
$viewMock::normalizePath('C:\xampp\htdocs\libs\Flight/core/index.php', '/') | ||
); | ||
self::assertSame( | ||
'C:\xampp\htdocs\libs\Flight\core\index.php', | ||
$viewMock::normalizePath('C:/xampp/htdocs/libs/Flight\core\index.php', '\\') | ||
); | ||
self::assertSame( | ||
'C:°xampp°htdocs°libs°Flight°core°index.php', | ||
$viewMock::normalizePath('C:/xampp/htdocs/libs/Flight\core\index.php', '°') | ||
); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this will fix the path....but then it throws an exception so nothing is really fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean about empty strings?