Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
08eefbcc
Commit
08eefbcc
authored
Nov 29, 2016
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Organize tests.
parent
7b318939
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
12 deletions
+41
-12
composer.json
composer.json
+2
-6
phpunit.xml
phpunit.xml
+6
-2
ExampleTest.php
tests/Feature/ExampleTest.php
+5
-2
TestCase.php
tests/TestCase.php
+7
-2
ExampleTest.php
tests/Unit/ExampleTest.php
+21
-0
No files found.
composer.json
View file @
08eefbcc
...
@@ -20,14 +20,10 @@
...
@@ -20,14 +20,10 @@
"database"
"database"
],
],
"psr-4"
:
{
"psr-4"
:
{
"App
\\
"
:
"app/"
"App
\\
"
:
"app/"
,
"Tests
\\
"
:
"tests/"
}
}
},
},
"autoload-dev"
:
{
"classmap"
:
[
"tests/TestCase.php"
]
},
"scripts"
:
{
"scripts"
:
{
"post-root-package-install"
:
[
"post-root-package-install"
:
[
"php -r
\"
file_exists('.env') || copy('.env.example', '.env');
\"
"
"php -r
\"
file_exists('.env') || copy('.env.example', '.env');
\"
"
...
...
phpunit.xml
View file @
08eefbcc
...
@@ -9,8 +9,12 @@
...
@@ -9,8 +9,12 @@
processIsolation=
"false"
processIsolation=
"false"
stopOnFailure=
"false"
>
stopOnFailure=
"false"
>
<testsuites>
<testsuites>
<testsuite
name=
"Application Test Suite"
>
<testsuite
name=
"Feature Tests"
>
<directory
suffix=
"Test.php"
>
./tests
</directory>
<directory
suffix=
"Test.php"
>
./tests/Feature
</directory>
</testsuite>
<testsuite
name=
"Unit Tests"
>
<directory
suffix=
"Test.php"
>
./tests/Unit
</directory>
</testsuite>
</testsuite>
</testsuites>
</testsuites>
<filter>
<filter>
...
...
tests/ExampleTest.php
→
tests/
Feature/
ExampleTest.php
View file @
08eefbcc
<?php
<?php
namespace
Tests\Feature
;
use
Tests\TestCase
;
use
Illuminate\Foundation\Testing\WithoutMiddleware
;
use
Illuminate\Foundation\Testing\WithoutMiddleware
;
use
Illuminate\Foundation\Testing\DatabaseMigrations
;
use
Illuminate\Foundation\Testing\DatabaseMigrations
;
use
Illuminate\Foundation\Testing\DatabaseTransactions
;
use
Illuminate\Foundation\Testing\DatabaseTransactions
;
...
@@ -7,11 +10,11 @@ use Illuminate\Foundation\Testing\DatabaseTransactions;
...
@@ -7,11 +10,11 @@ use Illuminate\Foundation\Testing\DatabaseTransactions;
class
ExampleTest
extends
TestCase
class
ExampleTest
extends
TestCase
{
{
/**
/**
* A basic
functional
test example.
* A basic test example.
*
*
* @return void
* @return void
*/
*/
public
function
testBasic
Example
()
public
function
testBasic
Test
()
{
{
$this
->
visit
(
'/'
)
$this
->
visit
(
'/'
)
->
see
(
'Laravel'
);
->
see
(
'Laravel'
);
...
...
tests/TestCase.php
View file @
08eefbcc
<?php
<?php
abstract
class
TestCase
extends
Illuminate\Foundation\Testing\TestCase
namespace
Tests
;
use
Illuminate\Contracts\Console\Kernel
;
use
Illuminate\Foundation\Testing\TestCase
as
BaseTestCase
;
abstract
class
TestCase
extends
BaseTestCase
{
{
/**
/**
* The base URL to use while testing the application.
* The base URL to use while testing the application.
...
@@ -18,7 +23,7 @@ abstract class TestCase extends Illuminate\Foundation\Testing\TestCase
...
@@ -18,7 +23,7 @@ abstract class TestCase extends Illuminate\Foundation\Testing\TestCase
{
{
$app
=
require
__DIR__
.
'/../bootstrap/app.php'
;
$app
=
require
__DIR__
.
'/../bootstrap/app.php'
;
$app
->
make
(
Illuminate\Contracts\Console\
Kernel
::
class
)
->
bootstrap
();
$app
->
make
(
Kernel
::
class
)
->
bootstrap
();
return
$app
;
return
$app
;
}
}
...
...
tests/Unit/ExampleTest.php
0 → 100644
View file @
08eefbcc
<?php
namespace
Tests\Unit
;
use
Tests\TestCase
;
use
Illuminate\Foundation\Testing\WithoutMiddleware
;
use
Illuminate\Foundation\Testing\DatabaseMigrations
;
use
Illuminate\Foundation\Testing\DatabaseTransactions
;
class
ExampleTest
extends
TestCase
{
/**
* A basic test example.
*
* @return void
*/
public
function
testBasicTest
()
{
$this
->
assertTrue
(
true
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment