Created
March 7, 2018 15:11
-
-
Save ludo237/3128c0cb3c517a9ec0d94144ba54e976 to your computer and use it in GitHub Desktop.
Laravel PHP custom assertions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests\Utils; | |
use Ramsey\Uuid\Uuid; | |
/** | |
* Trait Assertions | |
* @package Tests\Utils | |
*/ | |
trait Assertions | |
{ | |
/** | |
* Check if the given uuid is valid according to Ramsey\Uuid package | |
* @param string $uuid | |
*/ | |
public function assertUuidIsValid(string $uuid) | |
{ | |
$message = "The given uuid {$uuid} is not valid"; | |
self::assertThat(Uuid::isValid($uuid), self::isTrue(), $message); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment