Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
63851cc6
Commit
63851cc6
authored
Feb 25, 2018
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use namespaced PHPUnit
parent
182ecf05
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
5 additions
and
17 deletions
+5
-17
doc/testing.rst
doc/testing.rst
+4
-2
tests/Silex/Tests/Application/MonologTraitTest.php
tests/Silex/Tests/Application/MonologTraitTest.php
+0
-2
tests/Silex/Tests/Application/SecurityTraitTest.php
tests/Silex/Tests/Application/SecurityTraitTest.php
+0
-2
tests/Silex/Tests/Application/SwiftmailerTraitTest.php
tests/Silex/Tests/Application/SwiftmailerTraitTest.php
+0
-2
tests/Silex/Tests/Application/TranslationTraitTest.php
tests/Silex/Tests/Application/TranslationTraitTest.php
+0
-2
tests/Silex/Tests/Application/TwigTraitTest.php
tests/Silex/Tests/Application/TwigTraitTest.php
+0
-2
tests/Silex/Tests/Provider/MonologServiceProviderTest.php
tests/Silex/Tests/Provider/MonologServiceProviderTest.php
+1
-1
tests/Silex/Tests/Provider/ValidatorServiceProviderTest.php
tests/Silex/Tests/Provider/ValidatorServiceProviderTest.php
+0
-4
No files found.
doc/testing.rst
View file @
63851cc6
...
@@ -26,10 +26,12 @@ PHPUnit
...
@@ -26,10 +26,12 @@ PHPUnit
`PHPUnit <https://github.com/sebastianbergmann/phpunit>`_ is the de-facto
`PHPUnit <https://github.com/sebastianbergmann/phpunit>`_ is the de-facto
standard testing framework for PHP. It was built for writing unit tests, but it
standard testing framework for PHP. It was built for writing unit tests, but it
can be used for functional tests too. You write tests by creating a new class,
can be used for functional tests too. You write tests by creating a new class,
that extends the ``PHPUnit
_Framework_
TestCase``. Your test cases are methods
that extends the ``PHPUnit
\Framework\
TestCase``. Your test cases are methods
prefixed with ``test``::
prefixed with ``test``::
class ContactFormTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;
class ContactFormTest extends TestCase
{
{
public function testInitialPage()
public function testInitialPage()
{
{
...
...
tests/Silex/Tests/Application/MonologTraitTest.php
View file @
63851cc6
...
@@ -17,8 +17,6 @@ use Monolog\Handler\TestHandler;
...
@@ -17,8 +17,6 @@ use Monolog\Handler\TestHandler;
use
Monolog\Logger
;
use
Monolog\Logger
;
/**
/**
* MonologTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Fabien Potencier <fabien@symfony.com>
*/
*/
class
MonologTraitTest
extends
TestCase
class
MonologTraitTest
extends
TestCase
...
...
tests/Silex/Tests/Application/SecurityTraitTest.php
View file @
63851cc6
...
@@ -17,8 +17,6 @@ use Symfony\Component\Security\Core\User\User;
...
@@ -17,8 +17,6 @@ use Symfony\Component\Security\Core\User\User;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\HttpFoundation\Request
;
/**
/**
* SecurityTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Fabien Potencier <fabien@symfony.com>
*/
*/
class
SecurityTraitTest
extends
TestCase
class
SecurityTraitTest
extends
TestCase
...
...
tests/Silex/Tests/Application/SwiftmailerTraitTest.php
View file @
63851cc6
...
@@ -15,8 +15,6 @@ use PHPUnit\Framework\TestCase;
...
@@ -15,8 +15,6 @@ use PHPUnit\Framework\TestCase;
use
Silex\Provider\SwiftmailerServiceProvider
;
use
Silex\Provider\SwiftmailerServiceProvider
;
/**
/**
* SwiftmailerTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Fabien Potencier <fabien@symfony.com>
*/
*/
class
SwiftmailerTraitTest
extends
TestCase
class
SwiftmailerTraitTest
extends
TestCase
...
...
tests/Silex/Tests/Application/TranslationTraitTest.php
View file @
63851cc6
...
@@ -15,8 +15,6 @@ use PHPUnit\Framework\TestCase;
...
@@ -15,8 +15,6 @@ use PHPUnit\Framework\TestCase;
use
Silex\Provider\TranslationServiceProvider
;
use
Silex\Provider\TranslationServiceProvider
;
/**
/**
* TranslationTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Fabien Potencier <fabien@symfony.com>
*/
*/
class
TranslationTraitTest
extends
TestCase
class
TranslationTraitTest
extends
TestCase
...
...
tests/Silex/Tests/Application/TwigTraitTest.php
View file @
63851cc6
...
@@ -17,8 +17,6 @@ use Symfony\Component\HttpFoundation\Response;
...
@@ -17,8 +17,6 @@ use Symfony\Component\HttpFoundation\Response;
use
Symfony\Component\HttpFoundation\StreamedResponse
;
use
Symfony\Component\HttpFoundation\StreamedResponse
;
/**
/**
* TwigTrait test cases.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Fabien Potencier <fabien@symfony.com>
*/
*/
class
TwigTraitTest
extends
TestCase
class
TwigTraitTest
extends
TestCase
...
...
tests/Silex/Tests/Provider/MonologServiceProviderTest.php
View file @
63851cc6
...
@@ -11,10 +11,10 @@
...
@@ -11,10 +11,10 @@
namespace
Silex\Tests\Provider
;
namespace
Silex\Tests\Provider
;
use
PHPUnit\Framework\TestCase
;
use
Monolog\Formatter\JsonFormatter
;
use
Monolog\Formatter\JsonFormatter
;
use
Monolog\Handler\TestHandler
;
use
Monolog\Handler\TestHandler
;
use
Monolog\Logger
;
use
Monolog\Logger
;
use
PHPUnit\Framework\TestCase
;
use
Silex\Application
;
use
Silex\Application
;
use
Silex\Provider\MonologServiceProvider
;
use
Silex\Provider\MonologServiceProvider
;
use
Symfony\Component\HttpFoundation\RedirectResponse
;
use
Symfony\Component\HttpFoundation\RedirectResponse
;
...
...
tests/Silex/Tests/Provider/ValidatorServiceProviderTest.php
View file @
63851cc6
...
@@ -35,8 +35,6 @@ class ValidatorServiceProviderTest extends TestCase
...
@@ -35,8 +35,6 @@ class ValidatorServiceProviderTest extends TestCase
$app
->
register
(
new
ValidatorServiceProvider
());
$app
->
register
(
new
ValidatorServiceProvider
());
$app
->
register
(
new
FormServiceProvider
());
$app
->
register
(
new
FormServiceProvider
());
$this
->
assertInstanceOf
(
'Symfony\Component\Validator\Validator\ValidatorInterface'
,
$app
[
'validator'
]);
return
$app
;
return
$app
;
}
}
...
@@ -54,8 +52,6 @@ class ValidatorServiceProviderTest extends TestCase
...
@@ -54,8 +52,6 @@ class ValidatorServiceProviderTest extends TestCase
],
],
]);
]);
$this
->
assertInstanceOf
(
'Symfony\Component\Validator\Validator\ValidatorInterface'
,
$app
[
'validator'
]);
return
$app
;
return
$app
;
}
}
...
...
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