File tree Expand file tree Collapse file tree 5 files changed +83
-0
lines changed Expand file tree Collapse file tree 5 files changed +83
-0
lines changed Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3+ xsi : noNamespaceSchemaLocation =" vendor/phpunit/phpunit/phpunit.xsd"
4+ bootstrap =" vendor/autoload.php"
5+ colors =" true"
6+ >
7+ <testsuites >
8+ <testsuite name =" Test Suite" >
9+ <directory suffix =" Test.php" >./tests</directory >
10+ </testsuite >
11+ </testsuites >
12+ <source >
13+ <include >
14+ <directory >app</directory >
15+ <directory >src</directory >
16+ </include >
17+ </source >
18+ </phpunit >
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ test ('example ' , function () {
4+ expect (true )->toBeTrue ();
5+ });
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /*
4+ |--------------------------------------------------------------------------
5+ | Test Case
6+ |--------------------------------------------------------------------------
7+ |
8+ | The closure you provide to your test functions is always bound to a specific PHPUnit test
9+ | case class. By default, that class is "PHPUnit\Framework\TestCase". Of course, you may
10+ | need to change it using the "pest()" function to bind a different classes or traits.
11+ |
12+ */
13+
14+ pest ()->extend (Tests \TestCase::class)->in ('Feature ' );
15+
16+ /*
17+ |--------------------------------------------------------------------------
18+ | Expectations
19+ |--------------------------------------------------------------------------
20+ |
21+ | When you're writing tests, you often need to check that values meet certain conditions. The
22+ | "expect()" function gives you access to a set of "expectations" methods that you can use
23+ | to assert different things. Of course, you may extend the Expectation API at any time.
24+ |
25+ */
26+
27+ expect ()->extend ('toBeOne ' , function () {
28+ return $ this ->toBe (1 );
29+ });
30+
31+ /*
32+ |--------------------------------------------------------------------------
33+ | Functions
34+ |--------------------------------------------------------------------------
35+ |
36+ | While Pest is very powerful out-of-the-box, you may have some testing code specific to your
37+ | project that you don't want to repeat in every file. Here you can also expose helpers as
38+ | global functions to help you to reduce the number of lines of code in your test files.
39+ |
40+ */
41+
42+ function something ()
43+ {
44+ // ..
45+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Tests ;
4+
5+ use PHPUnit \Framework \TestCase as BaseTestCase ;
6+
7+ abstract class TestCase extends BaseTestCase
8+ {
9+ //
10+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ test ('example ' , function () {
4+ expect (true )->toBeTrue ();
5+ });
You can’t perform that action at this time.
0 commit comments