-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from HydrefLab/1.0.0
JediFaker tests and CI config
- Loading branch information
Showing
13 changed files
with
198 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
language: php | ||
|
||
php: | ||
- 7.1 | ||
- 7.2 | ||
|
||
before_script: | ||
- curl -s http://getcomposer.org/installer | php | ||
- php composer.phar install --dev --prefer-source | ||
|
||
script: | ||
- php vendor/bin/phpunit |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
#CHANGELOG | ||
#CHANGELOG | ||
|
||
## 14-01-2017 - v1.0.0 | ||
* Initial version |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<phpunit bootstrap="./vendor/autoload.php" colors="true"> | ||
<testsuite name="Application Test Suite"> | ||
<directory>./tests</directory> | ||
</testsuite> | ||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">./tests/</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace HydrefLab\JediFaker\Test; | ||
|
||
use Faker\Generator; | ||
use HydrefLab\JediFaker\Factory; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class FactoryTest extends TestCase | ||
{ | ||
public function testFactoryReturnsFakerGenerator() | ||
{ | ||
$faker = Factory::create(); | ||
$this->assertInstanceOf(Generator::class, $faker); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace HydrefLab\JediFaker\Test; | ||
|
||
use Faker\Generator; | ||
use HydrefLab\JediFaker\Factory; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class CharacterTest extends TestCase | ||
{ | ||
/** | ||
* @var Generator | ||
*/ | ||
protected $faker; | ||
|
||
public function setUp() | ||
{ | ||
$this->faker = Factory::create(); | ||
} | ||
|
||
public function testLightSideIsNotNull() | ||
{ | ||
$this->assertNotNull($this->faker->lightSide); | ||
} | ||
|
||
public function testDarkSideIsNotNull() | ||
{ | ||
$this->assertNotNull($this->faker->darkSide); | ||
} | ||
|
||
public function testCharacterIsNotNull() | ||
{ | ||
$this->assertNotNull($this->faker->character); | ||
} | ||
|
||
public function testQuotesNotNull() | ||
{ | ||
$this->assertNotNull($this->faker->quote); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace HydrefLab\JediFaker\Test; | ||
|
||
use HydrefLab\JediFaker\Factory; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class DroidTest extends TestCase | ||
{ | ||
public function testDroidIsNotNull() | ||
{ | ||
$faker = Factory::create(); | ||
$this->assertNotNull($faker->droid); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace HydrefLab\JediFaker\Test; | ||
|
||
use Faker\Generator; | ||
use HydrefLab\JediFaker\Factory; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class MovieTest extends TestCase | ||
{ | ||
/** | ||
* @var Generator | ||
*/ | ||
protected $faker; | ||
|
||
public function setUp() | ||
{ | ||
$this->faker = Factory::create(); | ||
} | ||
|
||
public function testEpisodeIsNotNull() | ||
{ | ||
$this->assertNotNull($this->faker->episode); | ||
} | ||
|
||
public function testEpisodeReturnsFirstEpisodeTitle() | ||
{ | ||
$this->assertEquals('Episode I: The Phantom Menace', $this->faker->episode(1)); | ||
} | ||
|
||
public function testEpisodeOpeningCrawlIsNotNull() | ||
{ | ||
$this->assertNotNull($this->faker->episodeOpeningCrawl); | ||
} | ||
|
||
public function testEpisodeOpeningCrawlReturnsFirstEpisodeCrawl() | ||
{ | ||
$this->assertEquals( | ||
"Turmoil has engulfed the\r\nGalactic Republic. The taxation\r\nof trade routes to outlying star\r\nsystems is in dispute.\r\n\r\nHoping to resolve the matter\r\nwith a blockade of deadly\r\nbattleships, the greedy Trade\r\nFederation has stopped all\r\nshipping to the small planet\r\nof Naboo.\r\n\r\nWhile the Congress of the\r\nRepublic endlessly debates\r\nthis alarming chain of events,\r\nthe Supreme Chancellor has\r\nsecretly dispatched two Jedi\r\nKnights, the guardians of\r\npeace and justice in the\r\ngalaxy, to settle the conflict....", | ||
$this->faker->episodeOpeningCrawl(1) | ||
); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace HydrefLab\JediFaker\Test; | ||
|
||
use HydrefLab\JediFaker\Factory; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class PlanetTest extends TestCase | ||
{ | ||
public function testDroidIsNotNull() | ||
{ | ||
$faker = Factory::create(); | ||
$this->assertNotNull($faker->planet); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace HydrefLab\JediFaker\Test; | ||
|
||
use HydrefLab\JediFaker\Factory; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class SpeciesTest extends TestCase | ||
{ | ||
public function testDroidIsNotNull() | ||
{ | ||
$faker = Factory::create(); | ||
$this->assertNotNull($faker->species); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace HydrefLab\JediFaker\Test; | ||
|
||
use HydrefLab\JediFaker\Factory; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class VehicleTest extends TestCase | ||
{ | ||
public function testDroidIsNotNull() | ||
{ | ||
$faker = Factory::create(); | ||
$this->assertNotNull($faker->vehicle); | ||
} | ||
} |