Skip to content

Commit cc4081a

Browse files
committed
ITT: seeInArtisanOutput and dontSeeInArtisanOutput assertions added.
1 parent 4ef0107 commit cc4081a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/Asserts/ArtisanAsserts.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,26 @@ protected function dontSeeArtisanOutput($output)
6161
$this->assertNotEquals($expected, $actual, "Failed asserting that artisan output is not `{$expected}`.");
6262
}
6363

64+
protected function seeInArtisanOutput($needle)
65+
{
66+
if (File::exists($needle)) {
67+
$needle = File::get($needle);
68+
}
69+
70+
$output = $this->getArtisanOutput();
71+
$this->assertContains($needle, $output, "Failed asserting that artisan output contains `{$needle}`.");
72+
}
73+
74+
protected function dontSeeInArtisanOutput($needle)
75+
{
76+
if (File::exists($needle)) {
77+
$needle = File::get($needle);
78+
}
79+
80+
$output = $this->getArtisanOutput();
81+
$this->assertNotContains($needle, $output, "Failed asserting that artisan output not contains `{$needle}`.");
82+
}
83+
6484
protected function seeArtisanTableOutput(array $data)
6585
{
6686
$message = 'Failed asserting that artisan table output consists of expected data.';

0 commit comments

Comments
 (0)