Skip to content

Commit 815f4a8

Browse files
committed
Merge pull request allure-framework#20 from vania-pooh/master
Changed default output directory to **/allure-results (fixes allure-framework#12)
2 parents c2f2743 + 0c7e1ee commit 815f4a8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Then add Allure test listener in **phpunit.xml** file:
4141
<listeners>
4242
<listener class="Yandex\Allure\Adapter\AllureAdapter" file="vendor/allure-framework/allure-phpunit/src/Yandex/Allure/Adapter/AllureAdapter.php">
4343
<arguments>
44-
<string>allure-report-data</string> <!-- XML files output directory -->
44+
<string>build/allure-results</string> <!-- XML files output directory -->
4545
<boolean>true</boolean> <!-- Whether to delete previous results on rerun -->
4646
<array> <!-- A list of custom annotations to ignore (optional) -->
4747
<element key="0">
@@ -181,7 +181,6 @@ If you wish to [attach some files](https://github.com/allure-framework/allure-co
181181
namespace Example\Tests;
182182

183183
use PHPUnit_Framework_TestCase;
184-
use Yandex\Allure\Adapter\Model\AttachmentType;
185184
use Yandex\Allure\Adapter\Support\AttachmentSupport;
186185

187186
class SomeTest extends PHPUnit_Framework_TestCase
@@ -193,7 +192,7 @@ class SomeTest extends PHPUnit_Framework_TestCase
193192
{
194193
//Some implementation here...
195194
$filePath = $this->outputSomeContentToTemporaryFile();
196-
$this->addAttachment($filePath, 'Attachment human-readable name', AttachmentType::TXT);
195+
$this->addAttachment($filePath, 'Attachment human-readable name', 'text/plain');
197196
//Some implementation here...
198197
}
199198

src/Yandex/Allure/Adapter/AllureAdapter.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
use Yandex\Allure\Adapter\Event\TestSuiteStartedEvent;
2020
use Yandex\Allure\Adapter\Model;
2121

22-
const DEFAULT_OUTPUT_DIRECTORY = "allure-report";
23-
2422
class AllureAdapter implements PHPUnit_Framework_TestListener
2523
{
2624

@@ -47,10 +45,13 @@ class AllureAdapter implements PHPUnit_Framework_TestListener
4745
* @param array $ignoredAnnotations Extra annotaions to ignore in addition to standard PHPUnit annotations
4846
*/
4947
public function __construct(
50-
$outputDirectory = DEFAULT_OUTPUT_DIRECTORY,
48+
$outputDirectory,
5149
$deletePreviousResults = false,
5250
array $ignoredAnnotations = []
5351
) {
52+
if (!isset($outputDirectory)){
53+
$outputDirectory = 'build' . DIRECTORY_SEPARATOR . 'allure-results';
54+
}
5455

5556
$this->prepareOutputDirectory($outputDirectory, $deletePreviousResults);
5657

0 commit comments

Comments
 (0)