| Total Complexity | 4 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class FetcherTest extends SapphireTest |
||
| 15 | { |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | private $importerKey = 'test'; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * |
||
| 24 | */ |
||
| 25 | public function setUp() |
||
| 26 | { |
||
| 27 | Config::modify()->remove(Fetcher::class, 'apiKey'); |
||
| 28 | return parent::setUp(); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @throws Exception |
||
| 33 | */ |
||
| 34 | public function testConstructorFailsWithoutAPIKey() |
||
| 35 | { |
||
| 36 | $this->expectException(Exception::class); |
||
| 37 | new Fetcher($this->importerKey); |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @throws Exception |
||
| 42 | */ |
||
| 43 | public function testConstructorFailsWithoutChannel() |
||
| 44 | { |
||
| 45 | Config::modify()->set(Fetcher::class, 'apiKey', 'API_KEY'); |
||
| 46 | $this->expectException(Exception::class); |
||
| 47 | new Fetcher($this->importerKey); |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @throws Exception |
||
| 52 | */ |
||
| 53 | public function testConstructor() |
||
| 60 | } |
||
| 61 | } |
||
| 62 |