You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ The main purpose of this adapter is to accumulate information about your tests a
8
8
## Example project
9
9
Example project is located at: https://github.com/allure-framework/allure-phpunit-example
10
10
11
-
## Usage
11
+
## Installation && Usage
12
12
**Note:** this adapter supports Allure 1.4.x only.
13
13
In order to use this adapter you need to add a new dependency to your **composer.json** file:
14
14
```
@@ -35,13 +35,13 @@ Then add Allure test listener in **phpunit.xml** file:
35
35
</listener>
36
36
</listeners>
37
37
```
38
-
After running PHPUnit tests a new folder will be created (**allure-report-data** in the example above). This folder will contain generated XML files. See [framework help](https://github.com/allure-framework/allure-core/wiki) for details about how to generate report from XML files. By default generated report will only show a limited set of information but you can use of cool Allure features by adding a minimum of test code changes. Read next section for details.
38
+
After running PHPUnit tests a new folder will be created (**allure-report-data** in the example above). This folder will contain generated XML files. See [framework help](https://github.com/allure-framework/allure-core/wiki) for details about how to generate report from XML files. By default generated report will only show a limited set of information but you can use cool Allure features by adding a minimum of test code changes. Read next section for details.
39
39
40
-
## Advanced features
41
-
This adapter comes with a set of PHP annotations and traits allowing to use some advanced Allure features.
40
+
## Main features
41
+
This adapter comes with a set of PHP annotations and traits allowing to use main Allure features.
42
42
43
43
### Human-readable test class or test method title
44
-
In order to add such title to any test class or test case method you need to annotate it with **@Title** annotation:
44
+
In order to add such title to any test class or [test case](https://github.com/allure-framework/allure-core/wiki/Glossary#test-case) method you need to annotate it with **@Title** annotation:
45
45
```php
46
46
namespace Example\Tests;
47
47
@@ -64,7 +64,7 @@ class SomeTest extends PHPUnit_Framework_TestCase
64
64
```
65
65
66
66
### Extended test class or test method description
67
-
Similarly you can add detailed description for each test class and test method. To add such description simply use **@Description** annotation:
67
+
Similarly you can add detailed description for each test class and [test method](https://github.com/allure-framework/allure-core/wiki/Glossary#test-case). To add such description simply use **@Description** annotation:
68
68
```php
69
69
namespace Example\Tests;
70
70
@@ -110,7 +110,7 @@ class SomeTest extends PHPUnit_Framework_TestCase
110
110
```
111
111
112
112
### Specify test parameters information
113
-
In order to add information about test method parameters you should use **@Parameter** annotation:
113
+
In order to add information about test method [parameters](https://github.com/allure-framework/allure-core/wiki/Glossary#parameter) you should use **@Parameter** annotation:
114
114
```php
115
115
namespace Example\Tests;
116
116
@@ -132,7 +132,7 @@ class SomeTest extends PHPUnit_Framework_TestCase
132
132
```
133
133
134
134
### Map test classes and test methods to features and stories
135
-
In some development approaches tests are classified by **stories** and **features**. If you're using this then you can annotate your test with **@Stories** and **@Features** annotations:
135
+
In some development approaches tests are classified by [stories](https://github.com/allure-framework/allure-core/wiki/Glossary#user-story) and [features](https://github.com/allure-framework/allure-core/wiki/Glossary#feature). If you're using this then you can annotate your test with **@Stories** and **@Features** annotations:
136
136
```php
137
137
namespace Example\Tests;
138
138
@@ -159,7 +159,7 @@ class SomeTest extends PHPUnit_Framework_TestCase
159
159
You will then be able to filter tests by specified features and stories in generated Allure report.
160
160
161
161
### Attach files to report
162
-
If you wish to attach some files generated during PHPUnit run (screenshots, log files, dumps and so on) to report - then you need to use **AttachmentSupport** trait in your test class:
162
+
If you wish to [attach some files](https://github.com/allure-framework/allure-core/wiki/Glossary#attachment) generated during PHPUnit run (screenshots, log files, dumps and so on) to report - then you need to use **AttachmentSupport** trait in your test class:
163
163
```php
164
164
namespace Example\Tests;
165
165
@@ -189,10 +189,10 @@ class SomeTest extends PHPUnit_Framework_TestCase
189
189
190
190
}
191
191
```
192
-
In order to create an attachment simply call **AttachmentSupport::addAttachment()** method. This method accepts attachment type, human-readable name and a string either storing full path to the file we need to attach or file contents.
192
+
In order to create an [attachment](https://github.com/allure-framework/allure-core/wiki/Glossary#attachment) simply call **AttachmentSupport::addAttachment()** method. This method accepts attachment type, human-readable name and a string either storing full path to the file we need to attach or file contents.
193
193
194
194
### Divide test methods into steps
195
-
Allure framework also supports very useful feature called **steps**. Consider a test method which has complex logic inside and several assertions. When an exception is thrown or one of assertions fails sometimes it's very difficult to determine which one caused the failure. Allure steps allow to divide test method logic into several isolated pieces having independent run statuses such as **passed** or **failed**. This allows to have much more cleaner understanding of what really happens. In order to use steps simply import **StepSupport** trait in your test class:
195
+
Allure framework also supports very useful feature called [steps](https://github.com/allure-framework/allure-core/wiki/Glossary#test-step). Consider a test method which has complex logic inside and several assertions. When an exception is thrown or one of assertions fails sometimes it's very difficult to determine which one caused the failure. Allure steps allow to divide test method logic into several isolated pieces having independent run statuses such as **passed** or **failed**. This allows to have much more cleaner understanding of what really happens. In order to use steps simply import **StepSupport** trait in your test class:
0 commit comments