mirror of
https://github.com/m-lamonaca/dev-notes.git
synced 2025-06-08 18:57:12 +00:00
remove mkdocs specific syntax
This commit is contained in:
parent
8d08c1964f
commit
8026e1465b
77 changed files with 1128 additions and 1128 deletions
|
@ -4,11 +4,11 @@
|
|||
|
||||
### Dev-Only Installation
|
||||
|
||||
```ps1 linenums="1"
|
||||
```ps1
|
||||
composer require --dev phpunit/phpunit
|
||||
```
|
||||
|
||||
```json linenums="1"
|
||||
```json
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "<version>"
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ composer require --dev phpunit/phpunit
|
|||
|
||||
PHPUnit can be configured in a XML file called `phpunit.xml`:
|
||||
|
||||
```xml linenums="1"
|
||||
```xml
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
|
||||
bootstrap="vendor/autoload.php"
|
||||
|
@ -46,7 +46,7 @@ PHPUnit can be configured in a XML file called `phpunit.xml`:
|
|||
A test is a method of a *test class* prefixed with `test`.
|
||||
PHPUnit is executed from the command line with `vendor/bin/phpunit --colors`.
|
||||
|
||||
```php linenums="1"
|
||||
```php
|
||||
namespace App;
|
||||
|
||||
class Filter
|
||||
|
@ -58,7 +58,7 @@ class Filter
|
|||
}
|
||||
```
|
||||
|
||||
```php linenums="1"
|
||||
```php
|
||||
namespace App\Test;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use App\Filter;
|
||||
|
@ -92,7 +92,7 @@ class FilterTest extends TestCase
|
|||
|
||||
### [PHPUnit Testing Exceptions](https://phpunit.readthedocs.io/en/9.3/writing-tests-for-phpunit.html#testing-exceptions)
|
||||
|
||||
```php linenums="1"
|
||||
```php
|
||||
public function testAggiungiEsameException(string $esame)
|
||||
{
|
||||
$this->expectException(Exception::class);
|
||||
|
@ -131,7 +131,7 @@ public function testNoExceptions(string $esame)
|
|||
|
||||
### Test Setup & Teardown (Example)
|
||||
|
||||
```php linenums="1"
|
||||
```php
|
||||
class ClassTest extends TestCase
|
||||
{
|
||||
// initialize the test
|
||||
|
@ -157,7 +157,7 @@ class ClassTest extends TestCase
|
|||
|
||||
### Data Provider
|
||||
|
||||
```php linenums="1"
|
||||
```php
|
||||
class DataTest extends TestCase
|
||||
{
|
||||
/**
|
||||
|
@ -195,7 +195,7 @@ class DataTest extends TestCase
|
|||
|
||||
### Mock Objects
|
||||
|
||||
```php linenums="1"
|
||||
```php
|
||||
class UnitTest extends TestCase
|
||||
{
|
||||
public function setUp()
|
||||
|
@ -225,6 +225,6 @@ class UnitTest extends TestCase
|
|||
|
||||
### Code Coverage (needs [XDebug](https://xdebug.org/))
|
||||
|
||||
```ps1 linenums="1"
|
||||
```ps1
|
||||
vendor/bin/phpunit --coverage-text # code coverage analysis in the terminal
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue