@@ -69,30 +69,28 @@ public function constantsTypeProvider()
69
69
/**
70
70
* @dataProvider validConstantTypesProvider
71
71
*/
72
- public function testValidConstantTypes ($ generator )
72
+ public function testValidConstantTypes ($ generator, $ expectedOutput )
73
73
{
74
74
$ propertyGenerator = new PropertyGenerator ('FOO ' , $ generator );
75
75
$ propertyGenerator ->setConst (true );
76
-
77
- $ this ->assertInternalType ('string ' , $ propertyGenerator ->generate ());
76
+ $ this ->assertSame ($ expectedOutput , $ propertyGenerator ->generate ());
78
77
}
79
78
80
79
public function validConstantTypesProvider ()
81
80
{
82
81
return [
83
- [new PropertyValueGenerator ([], PropertyValueGenerator::TYPE_ARRAY )],
84
- [new PropertyValueGenerator ([], PropertyValueGenerator::TYPE_ARRAY_LONG )],
85
- [new PropertyValueGenerator ([], PropertyValueGenerator::TYPE_ARRAY_SHORT )],
86
- [new PropertyValueGenerator (true , PropertyValueGenerator::TYPE_BOOL )],
87
- [new PropertyValueGenerator (true , PropertyValueGenerator::TYPE_BOOLEAN )],
88
- [new PropertyValueGenerator (1 , PropertyValueGenerator::TYPE_INT )],
89
- [new PropertyValueGenerator (1 , PropertyValueGenerator::TYPE_INTEGER )],
90
- [new PropertyValueGenerator (0.1 , PropertyValueGenerator::TYPE_DOUBLE )],
91
- [new PropertyValueGenerator (0.1 , PropertyValueGenerator::TYPE_FLOAT )],
92
- [new PropertyValueGenerator ('bar ' , PropertyValueGenerator::TYPE_STRING )],
93
- [new PropertyValueGenerator (null , PropertyValueGenerator::TYPE_NULL )],
94
- [new PropertyValueGenerator (null , PropertyValueGenerator::TYPE_NULL )],
95
- [new PropertyValueGenerator ('PHP_EOL ' , PropertyValueGenerator::TYPE_CONSTANT )],
82
+ [new PropertyValueGenerator ([], PropertyValueGenerator::TYPE_ARRAY , ValueGenerator::OUTPUT_SINGLE_LINE ), " const FOO = array(); " ],
83
+ [new PropertyValueGenerator ([], PropertyValueGenerator::TYPE_ARRAY_LONG , ValueGenerator::OUTPUT_SINGLE_LINE ), " const FOO = array(); " ],
84
+ [new PropertyValueGenerator ([], PropertyValueGenerator::TYPE_ARRAY_SHORT , ValueGenerator::OUTPUT_SINGLE_LINE ), " const FOO = []; " ],
85
+ [new PropertyValueGenerator (true , PropertyValueGenerator::TYPE_BOOL ), " const FOO = true; " ],
86
+ [new PropertyValueGenerator (true , PropertyValueGenerator::TYPE_BOOLEAN ), " const FOO = true; " ],
87
+ [new PropertyValueGenerator (1 , PropertyValueGenerator::TYPE_INT ), " const FOO = 1; " ],
88
+ [new PropertyValueGenerator (1 , PropertyValueGenerator::TYPE_INTEGER ), " const FOO = 1; " ],
89
+ [new PropertyValueGenerator (0.1 , PropertyValueGenerator::TYPE_DOUBLE ), " const FOO = 0.1; " ],
90
+ [new PropertyValueGenerator (0.1 , PropertyValueGenerator::TYPE_FLOAT ), " const FOO = 0.1; " ],
91
+ [new PropertyValueGenerator ('bar ' , PropertyValueGenerator::TYPE_STRING ), " const FOO = 'bar'; " ],
92
+ [new PropertyValueGenerator (null , PropertyValueGenerator::TYPE_NULL ), " const FOO = null; " ],
93
+ [new PropertyValueGenerator ('PHP_EOL ' , PropertyValueGenerator::TYPE_CONSTANT ), " const FOO = PHP_EOL; " ],
96
94
];
97
95
}
98
96
0 commit comments