mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-15 16:07:55 +03:00
Update coding style to include PSR-12, among other options
This also includes heavy use of slevomat/coding-standard to apply various checks to the code, based on maintainer (me) preference.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Ramsey\Uuid\Test\Generator;
|
||||
|
||||
use AspectMock\Test as AspectMock;
|
||||
@@ -132,7 +134,7 @@ class DefaultTimeGeneratorTest extends TestCase
|
||||
$this->timeConverter->method('calculateTime')
|
||||
->with($this->currentTime['sec'], $this->currentTime['usec'])
|
||||
->willReturn($this->calculatedTime);
|
||||
$binaryUtils = Mockery::mock('alias:'.BinaryUtils::class);
|
||||
$binaryUtils = Mockery::mock('alias:' . BinaryUtils::class);
|
||||
$binaryUtils->shouldReceive('applyVersion')
|
||||
->with($this->calculatedTime['hi'], 1)
|
||||
->andReturn(971);
|
||||
@@ -158,7 +160,7 @@ class DefaultTimeGeneratorTest extends TestCase
|
||||
{
|
||||
$this->timeProvider->method('currentTime')->willReturn($this->currentTime);
|
||||
$this->timeConverter->method('calculateTime')->willReturn($this->calculatedTime);
|
||||
$binaryUtils = Mockery::mock('alias:'.BinaryUtils::class);
|
||||
$binaryUtils = Mockery::mock('alias:' . BinaryUtils::class);
|
||||
$binaryUtils->shouldReceive('applyVersion')->andReturn(971);
|
||||
$binaryUtils->shouldReceive('applyVariant')->andReturn(143);
|
||||
|
||||
@@ -200,7 +202,7 @@ class DefaultTimeGeneratorTest extends TestCase
|
||||
*/
|
||||
public function testGenerateUsesRandomSequenceWhenClockSeqNull(): void
|
||||
{
|
||||
$random_int = AspectMock::func('Ramsey\Uuid\Generator', 'random_int', 9622);
|
||||
$randomInt = AspectMock::func('Ramsey\Uuid\Generator', 'random_int', 9622);
|
||||
$this->timeProvider->method('currentTime')
|
||||
->willReturn($this->currentTime);
|
||||
$this->timeConverter->expects($this->once())
|
||||
@@ -213,6 +215,6 @@ class DefaultTimeGeneratorTest extends TestCase
|
||||
$this->timeProvider
|
||||
);
|
||||
$defaultTimeGenerator->generate($this->nodeId);
|
||||
$random_int->verifyInvokedOnce([0, 0x3fff]);
|
||||
$randomInt->verifyInvokedOnce([0, 0x3fff]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user