Skip to content

Commit c4b25ae

Browse files
Remove tests that are too tightly coupled to TestCase implementation details
1 parent 6858204 commit c4b25ae

File tree

1 file changed

+0
-112
lines changed

1 file changed

+0
-112
lines changed

tests/unit/Util/TestDox/NamePrettifierTest.php

Lines changed: 0 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -62,116 +62,4 @@ public function testTestNameIsNotGroupedWhenNotInSequence(): void
6262
$this->assertEquals('Sets redirect header on 301', $this->namePrettifier->prettifyTestMethod('testSetsRedirectHeaderOn301'));
6363
$this->assertEquals('Sets redirect header on 302', $this->namePrettifier->prettifyTestMethod('testSetsRedirectHeaderOn302'));
6464
}
65-
66-
public function testPhpDoxIgnoreDataKeys(): void
67-
{
68-
$test = new class extends TestCase {
69-
public function __construct()
70-
{
71-
parent::__construct('testAddition', [
72-
'augend' => 1,
73-
'addend' => 2,
74-
'result' => 3,
75-
]);
76-
}
77-
78-
public function testAddition(int $augend, int $addend, int $result): void
79-
{
80-
}
81-
82-
public function getAnnotations(): array
83-
{
84-
return [
85-
'method' => [
86-
'testdox' => ['$augend + $addend = $result'],
87-
],
88-
];
89-
}
90-
};
91-
92-
$this->assertEquals('1 + 2 = 3', $this->namePrettifier->prettifyTestCase($test));
93-
}
94-
95-
public function testPhpDoxUsesDefaultValue(): void
96-
{
97-
$test = new class extends TestCase {
98-
public function __construct()
99-
{
100-
parent::__construct('testAddition', []);
101-
}
102-
103-
public function testAddition(int $augend = 1, int $addend = 2, int $result = 3): void
104-
{
105-
}
106-
107-
public function getAnnotations(): array
108-
{
109-
return [
110-
'method' => [
111-
'testdox' => ['$augend + $addend = $result'],
112-
],
113-
];
114-
}
115-
};
116-
117-
$this->assertEquals('1 + 2 = 3', $this->namePrettifier->prettifyTestCase($test));
118-
}
119-
120-
public function testPhpDoxArgumentExporting(): void
121-
{
122-
$test = new class extends TestCase {
123-
public function __construct()
124-
{
125-
parent::__construct('testExport', [
126-
'int' => 1234,
127-
'strInt' => '1234',
128-
'float' => 2.123,
129-
'strFloat' => '2.123',
130-
'string' => 'foo',
131-
'bool' => true,
132-
'null' => null,
133-
]);
134-
}
135-
136-
public function testExport($int, $strInt, $float, $strFloat, $string, $bool, $null): void
137-
{
138-
}
139-
140-
public function getAnnotations(): array
141-
{
142-
return [
143-
'method' => [
144-
'testdox' => ['$int, $strInt, $float, $strFloat, $string, $bool, $null'],
145-
],
146-
];
147-
}
148-
};
149-
150-
$this->assertEquals('1234, 1234, 2.123, 2.123, foo, true, NULL', $this->namePrettifier->prettifyTestCase($test));
151-
}
152-
153-
public function testPhpDoxReplacesLongerVariablesFirst(): void
154-
{
155-
$test = new class extends TestCase {
156-
public function __construct()
157-
{
158-
parent::__construct('testFoo', []);
159-
}
160-
161-
public function testFoo(int $a = 1, int $ab = 2, int $abc = 3): void
162-
{
163-
}
164-
165-
public function getAnnotations(): array
166-
{
167-
return [
168-
'method' => [
169-
'testdox' => ['$a, "$a", $a$ab, $abc, $abcd, $ab'],
170-
],
171-
];
172-
}
173-
};
174-
175-
$this->assertEquals('1, "1", 12, 3, $abcd, 2', $this->namePrettifier->prettifyTestCase($test));
176-
}
17765
}

0 commit comments

Comments
 (0)