File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,44 @@ 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>|null}>
68+ */
69+ public function provideLineNumber (): array
70+ {
71+ return [
72+ 'null ' => [null ],
73+ 'line 1 ' => [1 ],
74+ 'line 42 ' => [42 ],
75+ ];
76+ }
77+
78+ /**
79+ * @test
80+ *
81+ * @param int<1, max>|null $lineNumber
82+ *
83+ * @dataProvider provideLineNumber
84+ */
85+ public function getLineNumberReturnsLineNumberPassedToConstructor (?int $ lineNumber ): void
86+ {
87+ $ subject = new DeclarationBlock ($ lineNumber );
88+
89+ $ result = $ subject ->getLineNumber ();
90+
91+ self ::assertSame ($ lineNumber , $ result );
92+ }
93+
5694 /**
5795 * @return array<non-empty-string, array{0: non-empty-string}>
5896 */
You can’t perform that action at this time.
0 commit comments