Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 43d2cd6

Browse files
baszOcramius
authored andcommitted
test expectedOutput
1 parent 253911c commit 43d2cd6

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

test/Generator/ValueGeneratorTest.php

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,30 +69,28 @@ public function constantsTypeProvider()
6969
/**
7070
* @dataProvider validConstantTypesProvider
7171
*/
72-
public function testValidConstantTypes($generator)
72+
public function testValidConstantTypes($generator, $expectedOutput)
7373
{
7474
$propertyGenerator = new PropertyGenerator('FOO', $generator);
7575
$propertyGenerator->setConst(true);
76-
77-
$this->assertInternalType('string', $propertyGenerator->generate());
76+
$this->assertSame($expectedOutput, $propertyGenerator->generate());
7877
}
7978

8079
public function validConstantTypesProvider()
8180
{
8281
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;"],
9694
];
9795
}
9896

0 commit comments

Comments
 (0)