Skip to content

Commit

Permalink
Faker fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Dec 13, 2020
1 parent 303c79c commit 3c64795
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"require-dev": {
"doctrine/orm": "^2.5",
"illuminate/database": "5.0.* || 5.1.* || 5.5.* || ^6.0",
"league/factory-muffin-faker": "^2.0",
"league/factory-muffin-faker": "^2.3",
"phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20"
},
"replace": {
Expand Down
7 changes: 6 additions & 1 deletion tests/FactoryMuffinTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ public function testDefaultingToFaker()
$this->assertArrayHasKey('name', $obj->card);
$this->assertArrayHasKey('expirationDate', $obj->card);

$this->assertSame('https://lorempixel.com/400/600', substr($obj->image, 0, 30));
if (version_compare(PHP_VERSION, '7.1.0') >= 0 && !defined('HHVM_VERSION')) {
$this->assertSame('https://via.placeholder.com/400x600', substr($obj->image, 0, 35));
} else {
$this->assertSame('https://lorempixel.com/400/600', substr($obj->image, 0, 30));
}

$this->assertNotEquals('unique::text', $obj->unique_text);
$this->assertNotEquals('optional::text', $obj->optional_text);
}
Expand Down

0 comments on commit 3c64795

Please sign in to comment.