comparison vendor/symfony/validator/Test/TestCaseSetUpTearDownTrait.php @ 18:af1871eacc83

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:33:08 +0100
parents
children
comparison
equal deleted inserted replaced
17:129ea1e6d783 18:af1871eacc83
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 namespace Symfony\Component\Validator\Test;
13
14 use PHPUnit\Framework\TestCase;
15
16 // Auto-adapt to PHPUnit 8 that added a `void` return-type to the setUp/tearDown methods
17
18 if (method_exists(\ReflectionMethod::class, 'hasReturnType') && (new \ReflectionMethod(TestCase::class, 'tearDown'))->hasReturnType()) {
19 eval('
20 namespace Symfony\Component\Validator\Test;
21
22 /**
23 * @internal
24 */
25 trait TestCaseSetUpTearDownTrait
26 {
27 private function doSetUp(): void
28 {
29 }
30
31 private function doTearDown(): void
32 {
33 }
34
35 protected function setUp(): void
36 {
37 $this->doSetUp();
38 }
39
40 protected function tearDown(): void
41 {
42 $this->doTearDown();
43 }
44 }
45 ');
46 } else {
47 /**
48 * @internal
49 */
50 trait TestCaseSetUpTearDownTrait
51 {
52 /**
53 * @return void
54 */
55 private function doSetUp()
56 {
57 }
58
59 /**
60 * @return void
61 */
62 private function doTearDown()
63 {
64 }
65
66 /**
67 * @return void
68 */
69 protected function setUp()
70 {
71 $this->doSetUp();
72 }
73
74 /**
75 * @return void
76 */
77 protected function tearDown()
78 {
79 $this->doTearDown();
80 }
81 }
82 }