Skip to content

Commit ec84c3c

Browse files
committed
Add test
1 parent 485fadd commit ec84c3c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/Unit/ConfigurationTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Tests\Unit;
44

5+
use PhpWinTools\WmiScripting\Exceptions\InvalidConnectionException;
56
use Tests\TestCase;
67
use PhpWinTools\WmiScripting\Connection;
78
use PhpWinTools\WmiScripting\Configuration\Config;
@@ -86,6 +87,14 @@ public function it_can_return_a_new_instance_statically()
8687
$this->assertNotEquals($config, Config::newInstance());
8788
}
8889

90+
/** @test */
91+
public function it_throws_an_exception_when_trying_set_a_default_connection_that_doesnt_exist()
92+
{
93+
$this->expectException(InvalidConnectionException::class);
94+
95+
Config::instance()->setDefaultConnection('i do not exist');
96+
}
97+
8998
/** @test */
9099
public function it_can_return_an_instance_of_resolver()
91100
{

0 commit comments

Comments
 (0)