Phad.php
<?php
namespace Phad\Test\Unit;
class Phad extends \Phad\Tester {
/*
*/
public function testParseFillPattern(){
$this->test("Simple pattern fill");
$pattern = '/blog/{slug}/{title}/';
$filled = \Phad::fill_pattern($pattern, ['slug'=>'cat','title'=>'all-about-my-cat']);
$this->compare(
'/blog/cat/all-about-my-cat/',
$filled,
);
$this->test("params from pattern");
$params = ['slug', 'title'];
$parsed_params = \Phad::get_url_params($pattern);
$this->compare(
$params,
$parsed_params
);
}
}