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); }
public function setUp() { VfsStream::setup('Testrepo'); if (!class_exists('ZipArchive')) { $this->markTestSkipped('The ZipArchive class is not available.'); } $zip = new \ZipArchive(); if ($zip->open(__DIR__ . '/Fixtures/Testrepo.git.zip') === true) { $zip->extractTo(VfsStream::url('Testrepo')); $zip->close(); } else { $this->markTestSkipped('Couldn\'t extract repo zip'); } $repo_url = VfsStream::url('Testrepo') . '/Testrepo.git'; $transport = new NativeTransport($repo_url); $this->repo = new Repository(); $this->repo->setTransport($transport); $configurator = new Configurator(); $configurator->defaultConfigure($this->repo); $this->master_adapter = new GitternCommitishReadOnlyAdapter($this->repo, "master"); $this->index_adapter = new GitternIndexAdapter($this->repo); }