function it_returns_false_if_storages_are_valid(StorageFactory $storageFactory, Storage $storage_1, Storage $storage_2) { $storageFactory->makeAll()->willReturn(array($storage_1, $storage_2)); $this->beConstructedWith($storageFactory); $this->validate(); $this->getValidationErrorsString()->shouldReturn(false); }
public function validate() { foreach ($this->storageFactory->makeAll() as $storage) { try { $storage->validate(); } catch (TokenNotSetException $e) { $this->errors[] = $e->getMessage(); } catch (InvalidStorageException $e) { $this->errors[] = $e->getMessage(); } } }
function it_fills_the_storages_of_a_project(StorageFactory $storageFactory, $storages) { $storageFactory->makeByProjectName('my_project_1')->shouldBeCalled()->willReturn($storages); $project = $this->make('my_project_1'); $project->getStorages()->shouldReturn($storages); }