Skip to content

Commit b241d64

Browse files
test: remove redundant test/assertion in SharedFields/TextTraitTest (#205)
Co-authored-by: Claude <[email protected]>
1 parent 7f24f25 commit b241d64

File tree

1 file changed

+0
-53
lines changed

1 file changed

+0
-53
lines changed

tests/src/Unit/SharedFields/TextTraitTest.php

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -12,63 +12,10 @@
1212
*/
1313
class TextTraitTest extends TestCase
1414
{
15-
public function testSetTextIsPublic(): void
16-
{
17-
// This test kills the PublicVisibility mutation in TextTrait::setText
18-
// by using a class that uses the trait WITHOUT aliasing/overriding.
19-
//
20-
// Unlike PostData and Content which alias setText as traitSetText
21-
// and provide their own public setText, TextTraitTestClass uses
22-
// the trait's method directly. If the trait's method becomes
23-
// protected, this test will fail with a fatal error.
24-
$instance = new TextTraitTestClass();
25-
26-
// Calling setText from outside the class - would fail if protected
27-
$result = $instance->setText('test content');
28-
29-
// Verify method chaining works (returns self)
30-
$this->assertSame($instance, $result);
31-
32-
// Verify the text was set
33-
$this->assertTrue($instance->hasText());
34-
$this->assertEquals('test content', $instance->getText());
35-
}
36-
37-
public function testSetTextWithNull(): void
38-
{
39-
$instance = new TextTraitTestClass();
40-
$instance->setText('initial');
41-
$this->assertTrue($instance->hasText());
42-
43-
// Setting null should clear the text
44-
$instance->setText(null);
45-
$this->assertFalse($instance->hasText());
46-
$this->assertNull($instance->getText());
47-
}
48-
49-
public function testHasText(): void
50-
{
51-
$instance = new TextTraitTestClass();
52-
53-
// Initially no text
54-
$this->assertFalse($instance->hasText());
55-
56-
// After setting text
57-
$instance->setText('content');
58-
$this->assertTrue($instance->hasText());
59-
60-
// After clearing text
61-
$instance->setText(null);
62-
$this->assertFalse($instance->hasText());
63-
}
64-
6515
public function testGetText(): void
6616
{
6717
$instance = new TextTraitTestClass();
6818

69-
// Initially null
70-
$this->assertNull($instance->getText());
71-
7219
// After setting
7320
$instance->setText('some text');
7421
$this->assertEquals('some text', $instance->getText());

0 commit comments

Comments
 (0)