Skip to content

Commit

Permalink
Add tests for 100% code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
devanych committed Jan 16, 2022
1 parent cbf469b commit 30954c5
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/ApplicationRunnerTest.php
Expand Up @@ -5,6 +5,7 @@
namespace Yiisoft\Yii\Runner\Tests;

use PHPUnit\Framework\TestCase;
use Psr\Container\ContainerInterface;
use stdClass;
use Yiisoft\Config\Config;
use Yiisoft\Config\ConfigPaths;
Expand Down Expand Up @@ -84,6 +85,25 @@ public function testGetContainerAndWithContainer(): void
$this->assertSame($container, $runner->getContainer($this->createConfig(), 'web'));
}

public function testGetContainerAndWithNotYiiContainer(): void
{
$container = new class () implements ContainerInterface {
public function get(string $id): mixed
{
return null;
}

public function has(string $id): bool
{
return false;
}
};

$runner = (new ApplicationRunner())->withContainer($container);

$this->assertSame($container, $runner->getContainer($this->createConfig(), 'web'));
}

public function testRunBootstrap(): void
{
$runner = (new ApplicationRunner())->withBootstrap('bootstrap-web');
Expand Down

0 comments on commit 30954c5

Please sign in to comment.