Permalink
Browse files

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

  • Loading branch information...
1 parent e33e5de commit 187f6806a3caa4a0f6c789e6c80a556ae8195149 @nateabele nateabele committed Jul 8, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 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'));
+ }
}
?>

0 comments on commit 187f680

Please sign in to comment.