/** * @test */ public function add_withObject_addsObjectToFileTreeObjectsUnderPathAsKey() { $parent = Mockery::mock('FileSystem\\Directory', array('application', $this->root))->shouldIgnoreMissing(); $object = Mockery::mock('FileSystem\\Object', array('dashboard.php', $parent)); $this->fileTree->add($object); assertThat($this->fileTree->objects, hasEntry('/application/dashboard.php', $object)); }
/** * @test */ public function add_withDiskThatDoesNotExistInManager_setsDiskOnManager() { $disk = Mockery::mock('FileSystem\\Disk'); $disk->name = $name = 'local'; $this->manager->add($disk); assertThat($this->property($this->manager, 'disks'), hasEntry($name, $disk)); }
public function add($action, $message, $user = null) { $log = new Log(); $log->message = "{$action} : {$message}"; if (is_object($user) && hasEntry("id", $user)) { $log->user_id = $user->id; } $log->save(); }