8000 Fix for #18843 by inso · Pull Request #18861 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Fix for #18843 #18861

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added test for Inline::isHash
  • Loading branch information
Anton Bakai committed May 29, 2016
commit 1f5db46abb86ccff3f8568f6098f1543a7a6aa25
18 changes: 18 additions & 0 deletions src/Symfony/Component/Yaml/Tests/InlineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,24 @@ public function testParseUnquotedAsteriskFollowedByAComment()
Inline::parse('{ foo: * #foo }');
}

/**
* @dataProvider getDataForIsHash
*/
public function testIsHash($array, $expected)
{
$this->assertSame($expected, Inline::isHash($array));
}

public function getDataForIsHash()
{
return array(
array([], false),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot use the short array notation as we need to support PHP 5.3.

array([1, 2, 3], false),
array([2 => 1, 1 => 2, 0 => 3], true),
array(['foo' => 1, 'bar' => 2], true),
);
}

protected function getTestsForParse()
{
return array(
Expand Down
0