diff --git a/Config/seo.php.default b/Config/seo.php.default index e7e91a8..bb4d904 100644 --- a/Config/seo.php.default +++ b/Config/seo.php.default @@ -22,7 +22,7 @@ $config = array( 'threshold' => 5, //-1 to ALWAYS find the closest match 'cost_add' => 1, //cost to add a character, higher the amount the less you can add to find a match 'cost_change' => 1, //cost to change a character, higher the amount the less you can change to find a match - 'cost_delete' => 1, //cost to delete a character, higher the ammount the less you can delete to find a match + 'cost_delete' => 1, //cost to delete a character, higher the ammount the less you can delete to find a match 'source' => '/sitemap.xml' //URL to list of urls in a sitemap ), 'abTesting' => array( @@ -32,6 +32,15 @@ $config = array( 'legacy' => false, //Uses Legacy verion of Google Analytics JS code pageTracker._setCustomVar(...) 'session' => true, //will use sessions to store tests for users who've already seen them. 'redmine' => false, //or the full URL if your redmine http://www.redmine-example.com/issues/ - ) + ), + 'dnsPrefetch' => array( + //Default prefixes Examples. make sure to start each one with // or http:// or https:// + //'//use.typekit.net', + //'//maps.google.com', + //'//fonts.googleapis.com', + //'//maps.googleapis.com', + //'//www.google-analytics.com', + //'//www.googletagmanager.com', + ), ) ); diff --git a/Test/Case/controllers/SeoBlacklistsControllerTest.php b/Test/Case/Controller/SeoBlacklistsControllerTest.php similarity index 100% rename from Test/Case/controllers/SeoBlacklistsControllerTest.php rename to Test/Case/Controller/SeoBlacklistsControllerTest.php diff --git a/Test/Case/controllers/SeoUrlsControllerTest.php b/Test/Case/Controller/SeoUrlsControllerTest.php similarity index 100% rename from Test/Case/controllers/SeoUrlsControllerTest.php rename to Test/Case/Controller/SeoUrlsControllerTest.php diff --git a/Test/Case/controllers/empty b/Test/Case/Controller/empty similarity index 100% rename from Test/Case/controllers/empty rename to Test/Case/Controller/empty diff --git a/Test/Case/models/SeoBlacklistTest.php b/Test/Case/Model/SeoBlacklistTest.php similarity index 100% rename from Test/Case/models/SeoBlacklistTest.php rename to Test/Case/Model/SeoBlacklistTest.php diff --git a/Test/Case/models/SeoCanonicalTest.php b/Test/Case/Model/SeoCanonicalTest.php similarity index 100% rename from Test/Case/models/SeoCanonicalTest.php rename to Test/Case/Model/SeoCanonicalTest.php diff --git a/Test/Case/models/SeoHoneypotVisitTest.php b/Test/Case/Model/SeoHoneypotVisitTest.php similarity index 100% rename from Test/Case/models/SeoHoneypotVisitTest.php rename to Test/Case/Model/SeoHoneypotVisitTest.php diff --git a/Test/Case/models/SeoMetaTagTest.php b/Test/Case/Model/SeoMetaTagTest.php similarity index 100% rename from Test/Case/models/SeoMetaTagTest.php rename to Test/Case/Model/SeoMetaTagTest.php diff --git a/Test/Case/models/SeoRedirectTest.php b/Test/Case/Model/SeoRedirectTest.php similarity index 100% rename from Test/Case/models/SeoRedirectTest.php rename to Test/Case/Model/SeoRedirectTest.php diff --git a/Test/Case/models/SeoSearchTermTest.php b/Test/Case/Model/SeoSearchTermTest.php similarity index 100% rename from Test/Case/models/SeoSearchTermTest.php rename to Test/Case/Model/SeoSearchTermTest.php diff --git a/Test/Case/models/SeoStatusCodeTest.php b/Test/Case/Model/SeoStatusCodeTest.php similarity index 100% rename from Test/Case/models/SeoStatusCodeTest.php rename to Test/Case/Model/SeoStatusCodeTest.php diff --git a/Test/Case/models/SeoTitleTest.php b/Test/Case/Model/SeoTitleTest.php similarity index 100% rename from Test/Case/models/SeoTitleTest.php rename to Test/Case/Model/SeoTitleTest.php diff --git a/Test/Case/models/SeoUriTest.php b/Test/Case/Model/SeoUriTest.php similarity index 100% rename from Test/Case/models/SeoUriTest.php rename to Test/Case/Model/SeoUriTest.php diff --git a/Test/Case/models/SeoUrlTest.php b/Test/Case/Model/SeoUrlTest.php similarity index 100% rename from Test/Case/models/SeoUrlTest.php rename to Test/Case/Model/SeoUrlTest.php diff --git a/Test/Case/helpers/SeoHelperTest.php b/Test/Case/View/Helper/SeoHelperTest.php similarity index 85% rename from Test/Case/helpers/SeoHelperTest.php rename to Test/Case/View/Helper/SeoHelperTest.php index 5261226..9c79e8f 100755 --- a/Test/Case/helpers/SeoHelperTest.php +++ b/Test/Case/View/Helper/SeoHelperTest.php @@ -13,7 +13,7 @@ class SeoHelperTest extends CakeTestCase { 'plugin.seo.seo_canonical', 'plugin.seo.seo_a_b_test', ); - + function startTest() { $View = new View(); $this->Seo = new SeoHelper($View); @@ -23,77 +23,89 @@ function startTest() { Cache::clear($cacheEngine); } } - + function testGetABTestJS(){ $result = $this->Seo->getABTestJS(); - + + } + + function test_dnsPrefetch() { + //With Default DNS + $result = $this->Seo->dnsPrefetch(); + $this->assertEqual(null, $result); + + $result = $this->Seo->dnsPrefetch(array( + '//www.facebook.com', + '//use.typekit.net' + )); + $this->assertEual($result, ''); } - + function testCanonical(){ $result = $this->Seo->canonical('/example-url'); - $this->assertEqual('', $result); - + $this->assertEqual('', $result); + $result = $this->Seo->canonical(); $this->assertEqual('', $result); - + $_SERVER['REQUEST_URI'] = '/canonical'; $result = $this->Seo->canonical(); - $this->assertEqual('', $result); + $this->assertEqual('', $result); } - + function testHoneyPot(){ $result = $this->Seo->honeyPot(); $this->assertTrue(!empty($result)); } - + function testmetaTagsTags(){ $_SERVER['REQUEST_URI'] = '/uri_for_meta'; $results = $this->Seo->metaTags(); $this->assertEqual('', $results); - + $results = $this->Seo->metaTags(array('keywords' => 'ignore me')); $this->assertEqual('', $results); - + $results = $this->Seo->metaTags(array('no_ignore' => 'showme')); $this->assertEqual('', $results); } - + function testmetaTagsTagsWithHttpEquiv(){ $_SERVER['REQUEST_URI'] = '/uri_for_meta_equiv'; $results = $this->Seo->metaTags(); $this->assertEqual('', $results); } - + function testmetaTagsTagsWithOutAny(){ $_SERVER['REQUEST_URI'] = '/uri_has_not_meta'; $results = $this->Seo->metaTags(); $this->assertEqual('', $results); } - + function testmetaTagsTagsWithRegEx(){ $_SERVER['REQUEST_URI'] = '/uri_for_meta_reg_ex/this_should_match'; $results = $this->Seo->metaTags(); $this->assertEqual('', $results); } - + function testmetaTagsTagsDirectMatchShouldOverwrite(){ $_SERVER['REQUEST_URI'] = '/uri_for_meta_reg_ex/this_is_direct_match'; $results = $this->Seo->metaTags(); $this->assertEqual('', $results); } - + function testmetaTagsTagsWithWildCard(){ $_SERVER['REQUEST_URI'] = '/uri_for_meta_wild_card/wild_card'; $results = $this->Seo->metaTags(); $this->assertEqual('', $results); } - + function testTitleForUri(){ $_SERVER['REQUEST_URI'] = '/blah'; $results = $this->Seo->title(); $this->assertEqual('