Skip to content

Commit 3e599c4

Browse files
mvrieljaapio
authored andcommitted
Update property test with new expressions
1 parent 3e4aa91 commit 3e599c4

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
@@ -56,23 +56,23 @@ public function testGetFqsenAndGetName(): void
5656
{
5757
$property = new Property($this->fqsen);
5858

59-
$this->assertSame($this->fqsen, $property->getFqsen());
60-
$this->assertEquals($this->fqsen->getName(), $property->getName());
59+
self::assertSame($this->fqsen, $property->getFqsen());
60+
self::assertEquals($this->fqsen->getName(), $property->getName());
6161
}
6262

6363
public function testGettingWhetherPropertyIsStatic(): void
6464
{
6565
$property = new Property($this->fqsen, $this->visibility, $this->docBlock, null, false);
66-
$this->assertFalse($property->isStatic());
66+
self::assertFalse($property->isStatic());
6767

6868
$property = new Property($this->fqsen, $this->visibility, $this->docBlock, null, true);
69-
$this->assertTrue($property->isStatic());
69+
self::assertTrue($property->isStatic());
7070
}
7171

7272
public function testGettingWhetherPropertyIsReadOnly(): void
7373
{
7474
$property = new Property($this->fqsen, $this->visibility, $this->docBlock, null);
75-
$this->assertFalse($property->isReadOnly());
75+
self::assertFalse($property->isReadOnly());
7676

7777
$property = new Property(
7878
$this->fqsen,
@@ -86,38 +86,40 @@ public function testGettingWhetherPropertyIsReadOnly(): void
8686
true,
8787
);
8888

89-
$this->assertTrue($property->isReadOnly());
89+
self::assertTrue($property->isReadOnly());
9090
}
9191

9292
public function testGettingVisibility(): void
9393
{
9494
$property = new Property($this->fqsen, $this->visibility, $this->docBlock, null, true);
9595

96-
$this->assertSame($this->visibility, $property->getVisibility());
96+
self::assertSame($this->visibility, $property->getVisibility());
9797
}
9898

9999
public function testSetAndGetTypes(): void
100100
{
101101
$property = new Property($this->fqsen, $this->visibility, $this->docBlock, null, true);
102-
$this->assertEquals([], $property->getTypes());
102+
self::assertEquals([], $property->getTypes());
103103

104104
$property->addType('a');
105-
$this->assertEquals(['a'], $property->getTypes());
105+
self::assertEquals(['a'], $property->getTypes());
106106
}
107107

108108
public function testGetDefault(): void
109109
{
110110
$property = new Property($this->fqsen, $this->visibility, $this->docBlock, null, false);
111-
$this->assertNull($property->getDefault());
111+
self::assertNull($property->getDefault());
112112

113-
$property = new Property($this->fqsen, $this->visibility, $this->docBlock, 'a', true);
114-
$this->assertEquals('a', $property->getDefault());
113+
$expression = new Expression('a');
114+
$property = new Property($this->fqsen, $this->visibility, $this->docBlock, $expression, true);
115+
self::assertSame('a', $property->getDefault());
116+
self::assertSame($expression, $property->getDefault(false));
115117
}
116118

117119
public function testGetDocBlock(): void
118120
{
119121
$property = new Property($this->fqsen, $this->visibility, $this->docBlock, null, false);
120-
$this->assertSame($this->docBlock, $property->getDocBlock());
122+
self::assertSame($this->docBlock, $property->getDocBlock());
121123
}
122124

123125
public function testLineAndColumnNumberIsReturnedWhenALocationIsProvided(): void
@@ -140,9 +142,9 @@ public function testGetType(): void
140142
$type,
141143
);
142144

143-
$this->assertSame($type, $fixture->getType());
145+
self::assertSame($type, $fixture->getType());
144146

145147
$fixture = new Property($this->fqsen);
146-
$this->assertNull($fixture->getType());
148+
self::assertNull($fixture->getType());
147149
}
148150
}

0 commit comments

Comments
 (0)