Page MenuHomeDevCentral

TestCase.php
No OneTemporary

TestCase.php

<?php
namespace Nasqueron\Notifications\Tests\Console\Commands;
use Nasqueron\Notifications\Config\Services\Service;
use Nasqueron\Notifications\Tests\TestCase as BaseTestCase;
use Illuminate\Contracts\Console\Kernel;
use Symfony\Component\Console\Tester\CommandTester;
use Mockery;
class TestCase extends BaseTestCase {
///
/// Commands test environment
///
/**
* @var Symfony\Component\Console\Command
*/
protected $command;
/**
* @var Symfony\Component\Console\Tester\CommandTester;
*/
protected $tester;
public function setUp () {
parent::setUp();
$kernel = $this->app->make(Kernel::class);
$this->command = $kernel->getByClass($this->class);
$this->tester = new CommandTester($this->command);
}
///
/// Display assertions
///
public function assertDisplayContains(string $expectedNeedle) {
$this->assertContains(
$expectedNeedle,
$this->tester->getDisplay()
);
}
public function assertRegexpInDisplay (string $pattern) {
$this->assertRegexp($pattern, $this->tester->getDisplay());
}
}

File Metadata

Mime Type
text/x-php
Expires
Tue, Aug 18, 14:43 (5 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3951591
Default Alt Text
TestCase.php (1 KB)

Event Timeline