File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,43 @@ public function implementsPositionable(): void
5353 self ::assertInstanceOf (Positionable::class, $ this ->subject );
5454 }
5555
56+ /**
57+ * @test
58+ */
59+ public function getLineNumberByDefaultReturnsNull (): void
60+ {
61+ $ result = $ this ->subject ->getLineNumber ();
62+
63+ self ::assertNull ($ result );
64+ }
65+
66+ /**
67+ * @return array<non-empty-string, array{0: int<1, max>}>
68+ */
69+ public function provideLineNumber (): array
70+ {
71+ return [
72+ 'line 1 ' => [1 ],
73+ 'line 42 ' => [42 ],
74+ ];
75+ }
76+
77+ /**
78+ * @test
79+ *
80+ * @param int<1, max> $lineNumber
81+ *
82+ * @dataProvider provideLineNumber
83+ */
84+ public function getLineNumberReturnsLineNumberPassedToConstructor (int $ lineNumber ): void
85+ {
86+ $ subject = new DeclarationBlock ($ lineNumber );
87+
88+ $ result = $ subject ->getLineNumber ();
89+
90+ self ::assertSame ($ lineNumber , $ result );
91+ }
92+
5693 /**
5794 * @return array<non-empty-string, array{0: non-empty-string}>
5895 */
You can’t perform that action at this time.
0 commit comments