Skip to content

Commit

Permalink
Noindex test
Browse files Browse the repository at this point in the history
  • Loading branch information
JanPetterMG committed Mar 18, 2016
1 parent 3189f8a commit 514f9fb
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions test/cases/NoindexTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

namespace vipnytt\XRobotsTagParser\tests;

use vipnytt\XRobotsTagParser;

class NoindexTest extends \PHPUnit_Framework_TestCase
{
/**
* noindex test
*
* @dataProvider generateDataForTest
* @param string $url
* @param string $bot
* @param array $options
*/
public function testNoIndex($url, $bot, $options)
{
$parser = new XRobotsTagParser($url, $bot, $options);
$this->assertInstanceOf('vipnytt\XRobotsTagParser', $parser);

$this->assertTrue($parser->getRules(true)['noindex']);
$this->assertTrue($parser->getRules(false)['noindex']);
$this->assertTrue($parser->getRules(false)['noarchive']);
}

/**
* Generate test data
* @return array
*/
public function generateDataForTest()
{
return [
[
'http://example.com/',
'googlebot',
['headers' =>
[
'X-Robots-Tag: noindex'
]
]
]
];
}
}

0 comments on commit 514f9fb

Please sign in to comment.