MissingDatfileTest.php
1<?php
2
3
4class MissingDatfileTest extends \Codeception\TestCase\Test
5{
9 protected $guy;
10
15 protected $parser;
16
17 protected function _before()
18 {
19 $this->parser = new \Udger\Parser(
20 \Codeception\Util\Stub::makeEmpty("Psr\Log\LoggerInterface"),
21 \Codeception\Util\Stub::makeEmpty("Udger\Helper\IP"));
22 }
23
24 protected function _after()
25 {
26 }
27
28 // tests
29 public function testParseWithMissingDatfile()
30 {
31 $useragent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36';
32
33 $this->setExpectedException("Exception", "Unable to expand filepath");
34 $this->parser->parse($useragent);
35 }
36}