for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace DeGraciaMathieu\Clike\Tests;
use Mockery;
use PHPUnit\Framework\TestCase;
use DeGraciaMathieu\Clike\Command;
class IntegrationTest extends TestCase {
/** @test */
public function success()
{
$command = new Command();
$result = $command->execute(new Clear());
$expectedArray = [
[
'type' => 'info',
'content' => 'Output text...',
]
];
$this->assertNotNull($result['timestamp']);
$this->assertEquals($result['lines'], $expectedArray);
}
public function authorized()
$clear = Mockery::mock(new Clear())->makePartial();
$clear->shouldReceive('authorized')->andReturn(false);
$result = $command->execute($clear);
'type' => 'error',
'content' => '/clear is an unauthorized command.',