blessing-skin-server/tests/CommandsTest/SaltRandomCommandTest.php

19 lines
566 B
PHP
Raw Normal View History

2019-08-09 15:36:13 +08:00
<?php
namespace Tests;
class SaltRandomCommandTest extends TestCase
{
public function testGenerateSalt()
{
$result = bin2hex('deadbeef');
$this->mock(\Illuminate\Contracts\Encryption\Encrypter::class, function ($mock) {
$mock->shouldReceive('generateKey')->with('AES-128-CBC')->twice()->andReturn('deadbeef');
});
$this->artisan('salt:random')
->expectsOutput("Application salt [$result] set successfully.");
$this->artisan('salt:random --show')
->expectsOutput($result);
}
}