@@ -74,12 +74,65 @@ static function ($component): string {
7474 /**
7575 * @test
7676 */
77- public function getArrayRepresentationThrowsException (): void
77+ public function getArrayRepresentationIncludesClassName (): void
7878 {
79- $ this -> expectException (\BadMethodCallException::class );
79+ $ subject = new Declaration ( ' line-height ' );
8080
81- $ subject = new Declaration ( ' todo ' );
81+ $ result = $ subject -> getArrayRepresentation ( );
8282
83- $ subject ->getArrayRepresentation ();
83+ self ::assertSame ('Declaration ' , $ result ['class ' ]);
84+ }
85+
86+ /**
87+ * @test
88+ */
89+ public function getArrayRepresentationIncludesPropertyName (): void
90+ {
91+ $ propertyName = 'font-weight ' ;
92+ $ subject = new Declaration ($ propertyName );
93+
94+ $ result = $ subject ->getArrayRepresentation ();
95+
96+ self ::assertSame ($ propertyName , $ result ['propertyName ' ]);
97+ }
98+
99+ /**
100+ * @test
101+ */
102+ public function getArrayRepresentationIncludesPropertyValue (): void
103+ {
104+ $ subject = new Declaration ('font-weight ' );
105+ $ propertyValue = 'bold ' ;
106+ $ subject ->setValue ($ propertyValue );
107+
108+ $ result = $ subject ->getArrayRepresentation ();
109+
110+ self ::assertSame ($ propertyValue , $ result ['propertyValue ' ]);
111+ }
112+
113+ /**
114+ * @return array<non-empty-string, array{0: bool}>
115+ */
116+ public static function provideBooleans (): array
117+ {
118+ return [
119+ 'true ' => [true ],
120+ 'false ' => [false ],
121+ ];
122+ }
123+
124+ /**
125+ * @test
126+ *
127+ * @dataProvider provideBooleans
128+ */
129+ public function getArrayRepresentationIncludesImportantFlag (bool $ important ): void
130+ {
131+ $ subject = new Declaration ('font-weight ' );
132+ $ subject ->setIsImportant ($ important );
133+
134+ $ result = $ subject ->getArrayRepresentation ();
135+
136+ self ::assertSame ($ important , $ result ['important ' ]);
84137 }
85138}
0 commit comments