Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Gummibeer committed Feb 15, 2020
1 parent 5a2eda6 commit 2961fda
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tests/UsesUuidTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Illuminate\Support\Str;
use InvalidArgumentException;
use Orchestra\Testbench\TestCase;
use Ramsey\Uuid\Uuid;

final class UsesUuidTest extends TestCase
{
Expand All @@ -26,7 +27,7 @@ public function it_generates_uuid_on_creating()
$post = PostUuidAttribute::create([]);

static::assertIsString($post->getUuid());
static::assertTrue(Str::isUuid($post->uuid));
static::assertTrue(Uuid::isValid($post->uuid));
}

/** @test */
Expand All @@ -37,7 +38,7 @@ public function it_generates_uuid_on_creating_when_uuid_attribute_is_invalid()
]);

static::assertIsString($post->getUuid());
static::assertTrue(Str::isUuid($post->uuid));
static::assertTrue(Uuid::isValid($post->uuid));
static::assertNotEquals('foobar', $post->uuid);
}

Expand All @@ -51,7 +52,7 @@ public function it_does_not_generate_uuid_on_creating_when_uuid_attribute_is_val
]);

static::assertIsString($post->getUuid());
static::assertTrue(Str::isUuid($post->uuid));
static::assertTrue(Uuid::isValid($post->uuid));
static::assertSame($uuid, $post->uuid);
}

Expand All @@ -68,7 +69,7 @@ public function it_can_use_uuid_as_primary_key()

static::assertIsString($post->getUuid());
static::assertIsString($post->getKey());
static::assertTrue(Str::isUuid($post->getKey()));
static::assertTrue(Uuid::isValid($post->getKey()));
static::assertSame($uuid, $post->getKey());
static::assertSame($post->getUuid(), $post->getKey());
}
Expand All @@ -85,7 +86,7 @@ public function it_can_query_by_single_uuid_scope()
$post = PostUuidAttribute::byUuid($uuid)->firstOrFail();

static::assertIsString($post->getUuid());
static::assertTrue(Str::isUuid($post->uuid));
static::assertTrue(Uuid::isValid($post->uuid));
static::assertSame($uuid, $post->uuid);
}

Expand All @@ -101,7 +102,7 @@ public function it_can_query_by_uuid_interface_scope()
$post = PostUuidAttribute::byUuid($uuid)->firstOrFail();

static::assertIsString($post->getUuid());
static::assertTrue(Str::isUuid($post->uuid));
static::assertTrue(Uuid::isValid($post->uuid));
static::assertSame($uuid->toString(), $post->uuid);
}

Expand All @@ -117,7 +118,7 @@ public function it_can_query_by_multiple_uuid_scope()
$post = PostUuidAttribute::byUuid([$uuid, Str::uuid()])->firstOrFail();

static::assertIsString($post->getUuid());
static::assertTrue(Str::isUuid($post->uuid));
static::assertTrue(Uuid::isValid($post->uuid));
static::assertSame($uuid, $post->uuid);
}

Expand Down

0 comments on commit 2961fda

Please sign in to comment.