ParserAccountTest.php
1<?php
2
3namespace tests\Udger;
4
5class ParserAccountTest extends \Codeception\TestCase\Test
6{
10 protected $guy;
11
12 protected function _before()
13 {
14
15 }
16
17 protected function _after()
18 {
19 }
20
21 // tests
22 public function testAccount()
23 {
24 $parser = new \Udger\Parser(
25 \Codeception\Util\Stub::makeEmpty("Psr\Log\LoggerInterface"),
26 \Codeception\Util\Stub::makeEmpty("Udger\Helper\IP"));
27 $parser->setAccessKey("nosuchkey");
28
29 $this->setExpectedException("Exception");
30 $parser->account();
31 }
32
33 public function testAccountMissingKey()
34 {
35 $parser = new \Udger\Parser(
36 \Codeception\Util\Stub::makeEmpty("Psr\Log\LoggerInterface"),
37 \Codeception\Util\Stub::makeEmpty("Udger\Helper\IP"));
38
39 $this->setExpectedException("Exception", "access key not set");
40 $parser->account();
41 }
42}