expect($resolver->getBinaryRequest())->to->be->an->instanceof('Peridot\\WebDriverManager\\Binary\\Request\\StandardBinaryRequest'); }); it('should return the BinaryRequestInterface if given', function () { $request = new StandardBinaryRequest(); $resolver = new BinaryResolver($request); expect($resolver->getBinaryRequest())->to->equal($request); }); }); describe('->getBinaryDecompressor()', function () { it('should return a ZipDecompressor by default', function () { $resolver = new BinaryResolver(); expect($resolver->getBinaryDecompressor())->to->be->an->instanceof('Peridot\\WebDriverManager\\Binary\\Decompression\\ZipDecompressor'); }); it('should return the BinaryDecompressorInterface if given', function () { $decompressor = new ZipDecompressor(); $resolver = new BinaryResolver(null, $decompressor); expect($resolver->getBinaryDecompressor())->to->equal($decompressor); }); }); describe('->getSystem()', function () { it('should return a System by default', function () { $resolver = new BinaryResolver(); expect($resolver->getSystem())->to->be->an->instanceof('Peridot\\WebDriverManager\\OS\\System'); }); it('should return the SystemInterface if given', function () { $system = new System(); $resolver = new BinaryResolver(null, null, $system); expect($resolver->getSystem())->to->equal($system); }); }); });
$this->request->request(Argument::any())->willReturn('string'); $this->process = $this->getProphet()->prophesize('Peridot\\WebDriverManager\\Process\\SeleniumProcessInterface'); $this->manager = new Manager($this->resolver, $this->process->reveal()); $this->decompressor->setTargetPath($this->manager->getInstallPath() . '/chromedriver'); }); beforeEach(function () { $path = $this->manager->getInstallPath(); $selenium = glob("{$path}/selenium-server-standalone-*"); $chrome = glob("{$path}/chromedriver*"); $files = array_merge($selenium, $chrome); foreach ($files as $file) { unlink($file); } }); it('proxies resolver events', function () { $resolver = new BinaryResolver(); $manager = new Manager($resolver); $percent = 0; $manager->on('progress', function ($p) use(&$percent) { $percent = $p; }); $resolver->emit('progress', [50]); expect($percent)->to->equal(50); }); describe('->getInstallPath()', function () { it('should return a default path', function () { $path = realpath(__DIR__ . '/../binaries'); expect($this->manager->getInstallPath())->to->equal($path); }); it('should return a configured path', function () { $path = __DIR__;