Skip to content
This repository was archived by the owner on Dec 6, 2019. It is now read-only.

Commit

Permalink
Code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
emptynick committed Apr 2, 2019
1 parent 9fff38c commit 85495f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 44 deletions.
6 changes: 5 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
</testsuites>

<logging>
<log type="junit" target="build/report.junit.xml"/>
<log type="coverage-html" target="build/coverage" />
<log type="coverage-text" target="php://stdout" showUncoveredFiles="false" showOnlySummary="true"/>
</logging>
<filter>
<whitelist addUncoveredFilesFromWhitelist="false">
<directory suffix=".php">src/</directory>
Expand Down
44 changes: 1 addition & 43 deletions tests/Browser/RouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,5 @@

class RouteTest extends TestCase
{
protected function getEnvironmentSetUp($app)
{
$app['router']->get('hello', ['as' => 'hi', 'uses' => function () {
return 'hello world';
}]);
$app['router']->get('config', ['as' => 'hi', 'uses' => function () {
return config('new_config_item');
}]);
}

/** @test */
public function can_use_dusk()
{
$this->browse(function (Browser $browser) {
$browser->visit('hello')
->assertSee('hello world');
});
}

/** @test */
public function can_use_multiple_browsers()
{
$this->browse(function (Browser $browser, Browser $browserTwo) {
$browser->visit('hello')
->assertSee('hello world');
$browserTwo->visit('hello')
->assertSee('hello world');
});
}

/** @test */
public function can_tweak_the_application_within_a_test()
{
$this->tweakApplication(function ($app) {
$app['config']->set('new_config_item', 'Fantastic!');
});
$this->assertEquals('Fantastic!', config('new_config_item'));
$this->browse(function (Browser $browser, Browser $browserTwo) {
$browser->visit('config')
->assertSee('Fantastic!');
});
$this->removeApplicationTweaks();
}

}

0 comments on commit 85495f8

Please sign in to comment.