Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding test for `Media::asset()` with empty strings.

  • Loading branch information...
commit 187f6806a3caa4a0f6c789e6c80a556ae8195149 1 parent e33e5de
@nateabele nateabele authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 tests/cases/net/http/MediaTest.php
View
11 tests/cases/net/http/MediaTest.php
@@ -665,6 +665,17 @@ public function testContentNegotiationByUserAgent() {
)));
$this->assertEqual('iphone', Media::negotiate($request));
}
+
+ /**
+ * Tests that empty asset paths correctly return the base path for the asset type, and don't
+ * generate notices or errors.
+ */
+ public function testEmptyAssetPaths() {
+ $this->assertEqual('/img/', Media::asset('', 'image'));
+ $this->assertEqual('/css/.css', Media::asset('', 'css'));
+ $this->assertEqual('/js/.js', Media::asset('', 'js'));
+ $this->assertEqual('/', Media::asset('', 'generic'));
+ }
}
?>
Please sign in to comment.
Something went wrong with that request. Please try again.