assertTrue(AmberRobots::url_permitted("","www.google.com")); $this->assertTrue(AmberRobots::url_permitted("Donuts","www.google.com")); } public function testRobotsParse2() { $this->assertFalse(AmberRobots::url_permitted(<<assertTrue(AmberRobots::url_permitted(<<assertFalse(AmberRobots::url_permitted(<<assertTrue(AmberRobots::url_permitted(<<assertTrue(AmberRobots::url_permitted(<<assertTrue(AmberRobots::url_permitted(<</**//*/**//**//**//*/**//**//**//*/**//**//**//*/**//**//**//*/**//**//**//*/**//**//**//*/**//**//**//*/**//**//**//*/**//**//**//*/**//**//**//*/**//**//**//*/**//**//**//*/**//**//**//*/**//**//**//*/**//**//**//*/**//**//**//*/**//**//**//*/**//**//**//*/**//**//**//*/**//**//**//*/**//**//**//*/**//**//**//*/**//**//**//*/**//**//**//*/**//**/ EOD , "/")); } public function testCyberRobotsParseNoBlankLineAtEnd() { $this->assertFalse(AmberRobots::url_permitted(<<assertFalse(AmberRobots::url_permitted(<<assertFalse(AmberRobots::url_permitted(<<assertTrue(AmberRobots::url_permitted(<<assertFalse(AmberRobots::url_permitted(<<assertFalse(AmberRobots::url_permitted(<<extract_assets(""); $this->assertTrue(empty($result)); } /** * @dataProvider provider */ public function testBogusHTMLParse(AmberAssetHelper $a) { $result = $a->extract_assets("SDFfalsdhf>laassertTrue(empty($result)); } /** * @dataProvider provider */ public function testBaseRewrite(AmberAssetHelper $a) { $result = $a->rewrite_base_tag('And the band played on....'); $this->assertEquals($result,'And the band played on....'); } /** * @dataProvider provider */ public function testBaseRewrite2(AmberAssetHelper $a) { $result = $a->rewrite_base_tag('And the band played on....'); $this->assertEquals($result,'And the band played on....'); } /** * @dataProvider provider */ public function testBaseRewrite3(AmberAssetHelper $a) { $result = $a->rewrite_base_tag('And the band played on....'); $this->assertEquals($result,'And the band played on....'); } /** * @dataProvider provider */ public function testOneImage(AmberAssetHelper $a) { $s = <<And the band played on.... EOF; $result = $a->extract_assets($s); $this->assertTrue(count($result) == 1); $this->assertEquals($result[0],"../peacock.png"); } /** * @dataProvider provider */ public function testTwoImages(AmberAssetHelper $a) { $s = <<And the band played on....And the said to the leader. EOF; $result = $a->extract_assets($s); $this->assertEquals(count($result),2); $this->assertEquals($result[0],"../peacock.png"); $this->assertEquals($result[1],"http://band.com/band.jpg"); } /** * @dataProvider provider */ public function testStylesheet(AmberAssetHelper $a) { $s = << And the band played on....And the BAND said to the leader. EOF; $result = $a->extract_assets($s); $this->assertTrue(count($result) == 1); $this->assertTrue($result[0] == "banana.css"); } /** * @dataProvider provider */ public function testStylesheetMixedCase(AmberAssetHelper $a) { $s = << And the band played on....And the BAND said to the leader. EOF; $result = $a->extract_assets($s); $this->assertTrue(count($result) == 1); $this->assertTrue($result[0] == "banana.css"); } /** * @dataProvider provider */ public function testJavascript(AmberAssetHelper $a) { $s = << And the band played on....And the BAND said to the leader. EOF; $result = $a->extract_assets($s); $this->assertTrue(count($result) == 1); $this->assertEquals($result[0],"/ScriptResource.axd?d=AYP1ocISkwrIb0vXvAfvYbki5H-fzUh4bOWz3-sTZaJ96EB3jl_ZhEsh0s6EQJgauvkZeuKp9yVuc1Q47t3srJNgYCHQB7-vIS8A-wvNqnarUNjJbCiThM06cNjdOqghx7Caf4pRKLTDKWeKPGNVAmms_hc1&t=ffffffffdb0d1ac2"); } /** * @dataProvider provider */ public function testAsyncJavascript(AmberAssetHelper $a) { $s = << for all good to come to the aid of the party"; $assets = array("time" => array("url" => 'http://example.com/time'), 'men.jpg' => array('url' => 'http://example.com/men.jpg', 'body' => 'somebinaerystuff')); $result = $a->rewrite_links($body,$assets); $a = md5('http://example.com/men.jpg') . ".jpg"; $this->assertEquals("Now is the for all good to come to the aid of the party",$result); } /** * @dataProvider provider */ public function testIgnoreImagesWithInlineData(AmberAssetHelper $a) { $s = << EOF; $result = $a->extract_assets($s); $this->assertEquals(3,count($result)); sort($result); $this->assertEquals($result[0],"banana.css"); $this->assertEquals($result[1],"banana.js"); $this->assertEquals($result[2],"http://band.com/band.jpg"); } /** * @dataProvider provider */ public function testImagesWithSpacesInURL(AmberAssetHelper $a) { $s = <<