Skip to content

Commit

Permalink
Re-added the Selector test.
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Apr 8, 2014
1 parent 92c1619 commit cb0b159
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/SelectorTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
class SelectorTest extends PHPUnit_Framework_TestCase {
public function testGetName () {
$selector = new \Gajus\Vlad\Selector('foo[bar]');

$this->assertSame('foo[bar]', $selector->getName());
}

/**
* @dataProvider getPathProvider
*/
public function testGetPath ($selector, $path) {
$selector = new \Gajus\Vlad\Selector($selector);

$this->assertSame($path, $selector->getPath());
}

public function getPathProvider () {
return [
['foo', ['foo']],
['foo[bar]', ['foo', 'bar']],
['foo[bar][1]', ['foo', 'bar', '1']],
['foo[bar][]', ['foo', 'bar', '']]
];
}
}

0 comments on commit cb0b159

Please sign in to comment.