public function testGetSource() { $server = new ServerFactory(['source' => Mockery::mock('League\\Flysystem\\FilesystemInterface')]); $this->assertInstanceOf('League\\Flysystem\\FilesystemInterface', $server->getSource()); $server = new ServerFactory(['source' => sys_get_temp_dir()]); $this->assertInstanceOf('League\\Flysystem\\FilesystemInterface', $server->getSource()); }
public function testGetSourceWithNoneSet() { $this->setExpectedException('InvalidArgumentException', 'A "source" file system must be set.'); $server = new ServerFactory(); $server->getSource(); }
public function testGetSourceWithInvalidParam() { $this->setExpectedException('InvalidArgumentException', 'Invalid `source` parameter.'); $server = new ServerFactory([]); $server->getSource(); }