Skip to content

Commit

Permalink
replace usage of deprecated getMockForTrait
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldyrynda committed Sep 13, 2023
1 parent 25ed8d9 commit f71a674
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/Unit/UuidResolversTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Tests\Unit;

use Dyrynda\Database\Support\GeneratesUuid;
use Mockery;
use PHPUnit\Framework\TestCase;

class UuidResolversTest extends TestCase
Expand All @@ -29,12 +30,14 @@ public static function provider_for_it_handles_uuid_versions(): array
*/
public function it_handles_uuid_versions($version, $resolved)
{
/* @var \Dyrynda\Database\Support\GeneratesUuid $generator */
$generator = $this->getMockForTrait(GeneratesUuid::class, mockedMethods: [
'uuidVersion',
]);
$generator->method('uuidVersion')->willReturn($version);
$generator = Mockery::mock(UuidTestClass::class)->makePartial();
$generator->shouldReceive('uuidVersion')->once()->andReturn($version);

$this->assertSame($resolved, $generator->resolveUuidVersion());
}
}

class UuidTestClass
{
use GeneratesUuid;
}

0 comments on commit f71a674

Please sign in to comment.