bytic /
hello
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace ByTIC\Hello\Tests\Oauth\ServiceProvider\Traits; |
||||
| 4 | |||||
| 5 | use ByTIC\Hello\HelloServiceProvider; |
||||
| 6 | use ByTIC\Hello\Tests\AbstractTest; |
||||
| 7 | use ByTIC\Hello\Utility\ConfigHelper; |
||||
| 8 | use Mockery as m; |
||||
| 9 | use Nip\Container\Container; |
||||
| 10 | |||||
| 11 | /** |
||||
| 12 | * Class CryptKeysTraitTest |
||||
| 13 | * @package ByTIC\Hello\Tests\Oauth\ServiceProvider\Traits |
||||
| 14 | */ |
||||
| 15 | class CryptKeysTraitTest extends AbstractTest |
||||
| 16 | { |
||||
| 17 | public function testCanUseCryptoKeysFromConfig() |
||||
| 18 | { |
||||
| 19 | $config = m::mock(ConfigHelper::class)->makePartial(); |
||||
| 20 | $config->shouldReceive('get') |
||||
| 21 | // ->with('private_key', null) |
||||
| 22 | ->andReturn('-----BEGIN RSA PRIVATE KEY-----\nconfig\n-----END RSA PRIVATE KEY-----'); |
||||
| 23 | |||||
| 24 | $provider = new HelloServiceProvider(); |
||||
| 25 | $provider->setContainer(new Container()); |
||||
| 26 | |||||
| 27 | ConfigHelper::setConfig($config); |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 28 | |||||
| 29 | // Call protected makeCryptKey method |
||||
| 30 | $cryptKey = (function () { |
||||
| 31 | return $this->makeCryptKey('private'); |
||||
|
0 ignored issues
–
show
The method
makeCryptKey() does not exist on ByTIC\Hello\Tests\Oauth\...aits\CryptKeysTraitTest.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||||
| 32 | })->call($provider); |
||||
| 33 | |||||
| 34 | static::assertSame( |
||||
| 35 | "-----BEGIN RSA PRIVATE KEY-----\nconfig\n-----END RSA PRIVATE KEY-----", |
||||
| 36 | file_get_contents($cryptKey->getKeyPath()) |
||||
| 37 | ); |
||||
| 38 | } |
||||
| 39 | } |
||||
| 40 |