Skip to content

Commit 7422ed0

Browse files
committed
Issue #110: Split IsRecordingTrait out of RecordedTestTrait.
1 parent 41714e6 commit 7422ed0

2 files changed

Lines changed: 21 additions & 10 deletions

File tree

src/IsRecordingTrait.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
declare(strict_types = 1);
4+
5+
namespace Ock\Testing;
6+
7+
trait IsRecordingTrait {
8+
9+
/**
10+
* Checks whether the test runs in "recording" mode.
11+
*
12+
* @return bool
13+
* TRUE if the test runs in "recording" mode.
14+
*/
15+
protected function isRecording(): bool {
16+
return !!\getenv('UPDATE_TESTS');
17+
}
18+
19+
}

src/RecordedTestTrait.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,9 @@
3030
*/
3131
trait RecordedTestTrait {
3232

33-
private ?AssertionRecorderInterface $recorder = null;
33+
use IsRecordingTrait;
3434

35-
/**
36-
* Checks whether the test runs in "recording" mode.
37-
*
38-
* @return bool
39-
* TRUE if the test runs in "recording" mode.
40-
*/
41-
protected function isRecording(): bool {
42-
return !!\getenv('UPDATE_TESTS');
43-
}
35+
private ?AssertionRecorderInterface $recorder = null;
4436

4537
/**
4638
* Asserts that an array of objects is as recorded.

0 commit comments

Comments
 (0)