Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eb41c91

Browse filesBrowse files
committed
Merge branch 'hotfix-0.2.1' into stable
2 parents 1fc4850 + 42d951c commit eb41c91
Copy full SHA for eb41c91

File tree

Expand file treeCollapse file tree

6 files changed

+96
-1
lines changed
Filter options
Expand file treeCollapse file tree

6 files changed

+96
-1
lines changed

‎.travis.yml

Copy file name to clipboardExpand all lines: .travis.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ before_script:
99
- travis_retry composer self-update
1010
- travis_retry composer install --no-interaction --prefer-source --dev
1111

12-
script: php application
12+
script: vendor/bin/phpunit --coverage-clover=coverage.xml

‎composer.json

Copy file name to clipboardExpand all lines: composer.json
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,19 @@
1010
"illuminate/console": "5.4.*",
1111
"illuminate/events": "5.4.*"
1212
},
13+
"require-dev": {
14+
"phpunit/phpunit": "~5.0"
15+
},
1316
"autoload": {
1417
"psr-4": {
1518
"App\\": "app/"
1619
}
1720
},
21+
"autoload-dev": {
22+
"psr-4": {
23+
"Tests\\": "tests/"
24+
}
25+
},
1826
"config": {
1927
"preferred-install": "dist",
2028
"sort-packages": true

‎phpunit.xml

Copy file name to clipboard
+21Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit backupGlobals="false"
3+
backupStaticAttributes="false"
4+
bootstrap="bootstrap/autoload.php"
5+
colors="true"
6+
convertErrorsToExceptions="true"
7+
convertNoticesToExceptions="true"
8+
convertWarningsToExceptions="true"
9+
processIsolation="false"
10+
stopOnFailure="false">
11+
<testsuites>
12+
<testsuite name="Unit Tests">
13+
<directory suffix="Test.php">./tests/Unit</directory>
14+
</testsuite>
15+
</testsuites>
16+
<filter>
17+
<whitelist processUncoveredFilesFromWhitelist="true">
18+
<directory suffix=".php">./app</directory>
19+
</whitelist>
20+
</filter>
21+
</phpunit>

‎tests/CreatesApplication.php

Copy file name to clipboard
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace Tests;
4+
5+
trait CreatesApplication
6+
{
7+
/**
8+
* Creates the application.
9+
*
10+
* @return \App\Console\Application
11+
*/
12+
public function createApplication()
13+
{
14+
$app = require __DIR__.'/../bootstrap/app.php';
15+
16+
return $app;
17+
}
18+
}

‎tests/TestCase.php

Copy file name to clipboard
+25Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace Tests;
4+
5+
abstract class TestCase extends \PHPUnit_Framework_TestCase
6+
{
7+
use CreatesApplication;
8+
9+
/**
10+
* The Illuminate application instance.
11+
*
12+
* @var \App\Console\Application
13+
*/
14+
protected $app;
15+
16+
/**
17+
* Setup the test environment.
18+
*
19+
* @return void
20+
*/
21+
protected function setUp()
22+
{
23+
$this->app = $this->createApplication();
24+
}
25+
}

‎tests/Unit/MainCommandTest.php

Copy file name to clipboard
+23Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace Tests\Unit;
4+
5+
use Tests\TestCase;
6+
use App\Console\Commands\Main;
7+
use Illuminate\Foundation\Testing\DatabaseMigrations;
8+
use Illuminate\Foundation\Testing\DatabaseTransactions;
9+
10+
class MainCommandTest extends TestCase
11+
{
12+
/**
13+
* The main command test example.
14+
*
15+
* @return void
16+
*/
17+
public function testCall()
18+
{
19+
$this->app->call((new Main)->getName());
20+
21+
$this->assertTrue(trim($this->app->output()) === 'Love beautiful code? We do too.');
22+
}
23+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.