public function defaultConfigure(Repository $repo)
{
$repo->setHydrator('commit', new Hydrator\CommitHydrator($repo));
$repo->setHydrator('tree', new Hydrator\TreeHydrator($repo));
$repo->setHydrator('blob', new Hydrator\BlobHydrator($repo));
$repo->setDesiccator('blob', new Desiccator\BlobDesiccator());
$repo->setDesiccator('tree', new Desiccator\TreeDesiccator());
$repo->setDesiccator('commit', new Desiccator\CommitDesiccator());
$repo->setIndexHydrator(new Hydrator\IndexHydrator($repo));
$repo->setIndexDesiccator(new Desiccator\IndexDesiccator());
}
public function testCanDefaultConfigure() { $repo_mock = M::mock('Gittern\\Repository'); $repo_mock->shouldReceive('setHydrator')->with('blob', M::type('Gittern\\Hydrator\\BlobHydrator'))->once(); $repo_mock->shouldReceive('setHydrator')->with('commit', M::type('Gittern\\Hydrator\\CommitHydrator'))->once(); $repo_mock->shouldReceive('setHydrator')->with('tree', M::type('Gittern\\Hydrator\\TreeHydrator'))->once(); $repo_mock->shouldReceive('setDesiccator')->with('blob', M::type('Gittern\\Desiccator\\BlobDesiccator'))->once(); $repo_mock->shouldReceive('setDesiccator')->with('commit', M::type('Gittern\\Desiccator\\CommitDesiccator'))->once(); $repo_mock->shouldReceive('setDesiccator')->with('tree', M::type('Gittern\\Desiccator\\TreeDesiccator'))->once(); $repo_mock->shouldReceive('setIndexHydrator')->with(M::type('Gittern\\Hydrator\\IndexHydrator'))->once(); $repo_mock->shouldReceive('setIndexDesiccator')->with(M::type('Gittern\\Desiccator\\IndexDesiccator'))->once(); $configurator = new Configurator(); $configurator->defaultConfigure($repo_mock); }