Skip to content
Browse files

New unit test

This adds a unit test for Misc::absolutize_url: when the relative URL is
broken, the function should return the URL as-is. The underlying
IRI::absolutize returns false in such cases, but Misc::absolutize_url
used to unconditionally call the member function of this non-object,
leading to a PHP fatal error
  • Loading branch information...
1 parent 7c3b32a commit 01605879c912a40d65b79a06420abf8d1c8cadf1 @casta casta committed Aug 25, 2012
Showing with 17 additions and 0 deletions.
  1. +17 −0 tests/oldtests/absolutize/SPtests/bugs/invalid_relative.php
View
17 tests/oldtests/absolutize/SPtests/bugs/invalid_relative.php
@@ -0,0 +1,17 @@
+<?php
+
+class SimplePie_Absolutize_Test_Bug_Invalid_Relative extends SimplePie_Absolutize_Test
+{
+ function data()
+ {
+ $this->data['base'] = 'http://a/b/c/d';
+ $this->data['relative'] = 'http://http://a/b';
+ }
+
+ function expected()
+ {
+ $this->expected = 'http://http://a/b';
+ }
+}
+
+?>

0 comments on commit 0160587

Please sign in to comment.
Something went wrong with that request. Please try again.