Skip to content

Commit 060297f

Browse files
committed
Update property test with new expressions
1 parent 4fc6e44 commit 060297f

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

tests/unit/phpDocumentor/Reflection/Php/PropertyTest.php

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ public function testGetFqsenAndGetName(): void
6060
{
6161
$property = new Property($this->fqsen);
6262

63-
$this->assertSame($this->fqsen, $property->getFqsen());
64-
$this->assertEquals($this->fqsen->getName(), $property->getName());
63+
self::assertSame($this->fqsen, $property->getFqsen());
64+
self::assertEquals($this->fqsen->getName(), $property->getName());
6565
}
6666

6767
/**
@@ -73,10 +73,10 @@ public function testGetFqsenAndGetName(): void
7373
public function testGettingWhetherPropertyIsStatic(): void
7474
{
7575
$property = new Property($this->fqsen, $this->visibility, $this->docBlock, null, false);
76-
$this->assertFalse($property->isStatic());
76+
self::assertFalse($property->isStatic());
7777

7878
$property = new Property($this->fqsen, $this->visibility, $this->docBlock, null, true);
79-
$this->assertTrue($property->isStatic());
79+
self::assertTrue($property->isStatic());
8080
}
8181

8282
/**
@@ -88,7 +88,7 @@ public function testGettingWhetherPropertyIsStatic(): void
8888
public function testGettingWhetherPropertyIsReadOnly(): void
8989
{
9090
$property = new Property($this->fqsen, $this->visibility, $this->docBlock, null);
91-
$this->assertFalse($property->isReadOnly());
91+
self::assertFalse($property->isReadOnly());
9292

9393
$property = new Property(
9494
$this->fqsen,
@@ -102,7 +102,7 @@ public function testGettingWhetherPropertyIsReadOnly(): void
102102
true
103103
);
104104

105-
$this->assertTrue($property->isReadOnly());
105+
self::assertTrue($property->isReadOnly());
106106
}
107107

108108
/**
@@ -115,7 +115,7 @@ public function testGettingVisibility(): void
115115
{
116116
$property = new Property($this->fqsen, $this->visibility, $this->docBlock, null, true);
117117

118-
$this->assertSame($this->visibility, $property->getVisibility());
118+
self::assertSame($this->visibility, $property->getVisibility());
119119
}
120120

121121
/**
@@ -127,10 +127,10 @@ public function testGettingVisibility(): void
127127
public function testSetAndGetTypes(): void
128128
{
129129
$property = new Property($this->fqsen, $this->visibility, $this->docBlock, null, true);
130-
$this->assertEquals([], $property->getTypes());
130+
self::assertEquals([], $property->getTypes());
131131

132132
$property->addType('a');
133-
$this->assertEquals(['a'], $property->getTypes());
133+
self::assertEquals(['a'], $property->getTypes());
134134
}
135135

136136
/**
@@ -141,10 +141,12 @@ public function testSetAndGetTypes(): void
141141
public function testGetDefault(): void
142142
{
143143
$property = new Property($this->fqsen, $this->visibility, $this->docBlock, null, false);
144-
$this->assertNull($property->getDefault());
144+
self::assertNull($property->getDefault());
145145

146-
$property = new Property($this->fqsen, $this->visibility, $this->docBlock, 'a', true);
147-
$this->assertEquals('a', $property->getDefault());
146+
$expression = new Expression('a');
147+
$property = new Property($this->fqsen, $this->visibility, $this->docBlock, $expression, true);
148+
self::assertSame('a', $property->getDefault());
149+
self::assertSame($expression, $property->getDefault(false));
148150
}
149151

150152
/**
@@ -155,7 +157,7 @@ public function testGetDefault(): void
155157
public function testGetDocBlock(): void
156158
{
157159
$property = new Property($this->fqsen, $this->visibility, $this->docBlock, null, false);
158-
$this->assertSame($this->docBlock, $property->getDocBlock());
160+
self::assertSame($this->docBlock, $property->getDocBlock());
159161
}
160162

161163
public function testLineAndColumnNumberIsReturnedWhenALocationIsProvided(): void
@@ -184,9 +186,9 @@ public function testGetType(): void
184186
$type
185187
);
186188

187-
$this->assertSame($type, $fixture->getType());
189+
self::assertSame($type, $fixture->getType());
188190

189191
$fixture = new Property($this->fqsen);
190-
$this->assertNull($fixture->getType());
192+
self::assertNull($fixture->getType());
191193
}
192194
}

0 commit comments

Comments
 (0)