Skip to content

Commit d26a5b1

Browse files
authored
[minor] use zenstruck/assert for assertions instead of phpunit (#1)
1 parent 5862544 commit d26a5b1

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
],
1414
"require": {
1515
"php": ">=7.4",
16-
"symfony/console": "^4.4.5|^5.0|^6.0"
16+
"symfony/console": "^4.4.5|^5.0|^6.0",
17+
"zenstruck/assert": "^1.0"
1718
},
1819
"require-dev": {
1920
"phpunit/phpunit": "^9.5.0",

src/CommandResult.php

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

33
namespace Zenstruck\Console\Test;
44

5-
use PHPUnit\Framework\Assert as PHPUnit;
65
use Symfony\Component\VarDumper\VarDumper;
6+
use Zenstruck\Assert;
77

88
/**
99
* @author Kevin Bond <kevinbond@gmail.com>
@@ -41,28 +41,28 @@ public function errorOutput(): string
4141

4242
public function assertOutputContains(string $expected): self
4343
{
44-
PHPUnit::assertStringContainsString($expected, $this->output());
44+
Assert::that($this->output())->contains($expected);
4545

4646
return $this;
4747
}
4848

4949
public function assertOutputNotContains(string $expected): self
5050
{
51-
PHPUnit::assertStringNotContainsString($expected, $this->output());
51+
Assert::that($this->output())->doesNotContain($expected);
5252

5353
return $this;
5454
}
5555

5656
public function assertErrorOutputContains(string $expected): self
5757
{
58-
PHPUnit::assertStringContainsString($expected, $this->errorOutput());
58+
Assert::that($this->errorOutput())->contains($expected);
5959

6060
return $this;
6161
}
6262

6363
public function assertErrorOutputNotContains(string $expected): self
6464
{
65-
PHPUnit::assertStringNotContainsString($expected, $this->errorOutput());
65+
Assert::that($this->errorOutput())->doesNotContain($expected);
6666

6767
return $this;
6868
}
@@ -74,7 +74,7 @@ public function assertSuccessful(): self
7474

7575
public function assertStatusCode(int $expected): self
7676
{
77-
PHPUnit::assertSame($expected, $this->statusCode());
77+
Assert::that($this->statusCode())->is($expected);
7878

7979
return $this;
8080
}

0 commit comments

Comments
 (0)