Skip to content

Commit b6161d7

Browse files
Minor test for GeneralCrawler
1 parent b82adae commit b6161d7

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

Scraper/Scrape/Crawler/BaseCrawler.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,6 @@ public static function className()
8484
return get_called_class();
8585
}
8686

87-
/**
88-
* Sets relay network ahead of the url. Useful when using TOR Relay networks
89-
*
90-
* @param $relayNetwork
91-
*/
92-
public function setRelayNetwork($relayNetwork)
93-
{
94-
95-
$this->currentUrl = $relayNetwork . $this->currentUrl;
96-
}
97-
9887
/**
9988
* Gets current page
10089
*

Scraper/Scrape/Crawler/Types/ProxyCrawler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/**
1212
* Class ProxyCrawler
1313
* @package Scraper\Scrape\Crawler\Types
14-
* @codeCoverageIgnore
14+
*
1515
*/
1616
class ProxyCrawler extends GeneralCrawler
1717
{
@@ -22,6 +22,7 @@ class ProxyCrawler extends GeneralCrawler
2222
*
2323
* @return mixed|void
2424
* @throws \Exception
25+
* @codeCoverageIgnore
2526
*/
2627
public function setProxy(Proxy $proxy)
2728
{

Scraper/Scrape/Extractor/BaseExtractor.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public function __construct(BaseCrawler $crawler, Configuration $configuration)
4141

4242
/**
4343
* Returns class name
44+
* @codeCoverageIgnore
4445
*
4546
* @return string
4647
*/
@@ -52,6 +53,7 @@ public static function className()
5253

5354
/**
5455
* Extracts data from crawled markup
56+
* @codeCoverageIgnore
5557
*
5658
* @return mixed
5759
*/

Tests/Unit/Scrape/Crawler/Types/GeneralCrawlerTest.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22

33
namespace Tests\Unit\Scrape\Crawler\Types;
44

5-
class GeneralCrawlerTest
6-
{
5+
use Concise\Core\TestCase;
6+
use Scraper\Scrape\Crawler\Types\GeneralCrawler;
77

8+
class GeneralCrawlerTest extends TestCase
9+
{
10+
public function testCanGetClassName()
11+
{
12+
$this->assertEquals(
13+
'Scraper\Scrape\Crawler\Types\GeneralCrawler',
14+
GeneralCrawler::className()
15+
);
16+
}
817
}

0 commit comments

Comments
 (0)