Skip to content

Commit 9d50944

Browse files
Update Testing documentation (#180)
Update composer command to use beta stability (fixes minimum stability error) Update setup.php example with up to date code Update examples to remove unneeded array commas for consistency
1 parent 14c434e commit 9d50944

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

docs/extend/testing.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ It is essentially a collection of utils that allow testing Flarum core and exten
1212

1313
Firstly, you will need to require the `flarum/testing` composer package as a dev dependency for your extension:
1414

15-
`composer require --dev flarum/testing`
15+
`composer require --dev flarum/testing:^0.1.0-beta.16`
1616

1717
Then, you will need to set up a file structure for tests, and add PHPUnit configuration:
1818

@@ -86,18 +86,11 @@ This script will be run to set up a testing database / file structure.
8686
```php
8787
<?php
8888

89-
/*
90-
* This file is part of Flarum.
91-
*
92-
* For detailed copyright and license information, please view the
93-
* LICENSE file that was distributed with this source code.
94-
*/
95-
96-
use Flarum\Testing\integration\ConfigureSetup;
89+
use Flarum\Testing\integration\Setup\SetupScript;
9790

9891
require __DIR__.'/../../vendor/autoload.php';
9992

100-
$setup = new ConfigureSetup(__DIR__.'/../../vendor');
93+
$setup = new SetupScript();
10194

10295
$setup->run();
10396
```
@@ -290,10 +283,10 @@ class SomeTest extends TestCase
290283
'attributes' => [
291284
'username' => 'test',
292285
'password' => 'too-obscure',
293-
'email' => 'test@machine.local',
294-
],
286+
'email' => 'test@machine.local'
287+
]
295288
]
296-
],
289+
]
297290
]
298291
)
299292
);

0 commit comments

Comments
 (0)