for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class UserAgentTest extends PHPUnit_Framework_TestCase
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
protected $CrawlerDetect;
public function setUp()
$this->CrawlerDetect = new Jaybizzle\CrawlerDetect\CrawlerDetect();
}
public function testBots()
$lines = file(__DIR__.'/crawlers.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES));
foreach ($lines as $line) {
$test = $this->CrawlerDetect->isCrawler($line);
$this->assertEquals($test, true, $line);
public function testDevices()
$lines = file(__DIR__.'/devices.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES));
$this->assertEquals($test, false, $line);
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.