Skip to content

Commit fd6dc73

Browse files
committed
Add tests for DeclarationBlock constructor in conjunction with getRuleSet()
1 parent 011c901 commit fd6dc73

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/Unit/RuleSet/DeclarationBlockTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,4 +252,30 @@ public function getRuleSetReturnsObjectWithRulesSet(array $propertyNamesToSet):
252252

253253
self::assertSame($rules, $result->getRules());
254254
}
255+
256+
/**
257+
* @test
258+
*/
259+
public function getRuleSetByDefaultReturnsObjectWithNullLineNumber(): void
260+
{
261+
$result = $this->subject->getRuleSet();
262+
263+
self::assertNull($result->getLineNumber());
264+
}
265+
266+
/**
267+
* @test
268+
*
269+
* @param int<1, max> $lineNumber
270+
*
271+
* @dataProvider provideLineNumber
272+
*/
273+
public function getRuleSetReturnsObjectWithLineNumberPassedToConstructor(int $lineNumber): void
274+
{
275+
$subject = new DeclarationBlock($lineNumber);
276+
277+
$result = $subject->getRuleSet();
278+
279+
self::assertSame($lineNumber, $subject->getLineNumber());
280+
}
255281
}

0 commit comments

Comments
 (0)