/** * Ease returns of empty DatabaseAccessResult * * Example: * stub('Dao')->getStuff()->returnsEmptyDar() */ public function returnsEmptyDar() { return $this->returns(TestHelper::emptyDar()); }
public function itReturnsEmptyArrayWhenNoSharedFields() { $project_id = 1; $dar = TestHelper::emptyDar(); $factory = $this->GivenSearchAllSharedTargetsOfProjectReturnsDar($dar, $project_id); $this->ThenICompareProjectSharedFieldsWithExpectedResult($factory, $project_id, array()); }
public function itDoesntRemoveTheGerritReservedKeys() { $this->user_manager->setReturnValueAt(0, 'getUsersWithSshKey', TestHelper::arrayToDar(new PFUser(array('authorized_keys' => $this->key1, 'user_name' => 'john_do')))); $this->mass_dumper->dumpSSHKeys(); $keyfile = '*****@*****.**'; touch($this->_glAdmDir . '/keydir/' . $keyfile); $this->gitExec->add($this->_glAdmDir . '/keydir/' . $keyfile); $this->gitExec->commit("Gerrit key"); $this->assertEmptyGitStatus(); $this->user_manager->setReturnValueAt(1, 'getUsersWithSshKey', TestHelper::emptyDar()); $this->mass_dumper->dumpSSHKeys(); $this->assertFalse(is_file($this->_glAdmDir . '/keydir/john_do@0.pub')); $this->assertTrue(is_file($this->_glAdmDir . '/keydir/' . $keyfile)); }