当前位置: 首页>>代码示例>>PHP>>正文


PHP IOInterface::expects方法代码示例

本文整理汇总了PHP中Composer\IO\IOInterface::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP IOInterface::expects方法的具体用法?PHP IOInterface::expects怎么用?PHP IOInterface::expects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Composer\IO\IOInterface的用法示例。


在下文中一共展示了IOInterface::expects方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: aliasMapConfigIsExtractedFromDeprecatedKey

 /**
  * @test
  */
 public function aliasMapConfigIsExtractedFromDeprecatedKey()
 {
     $this->packageMock->expects($this->any())->method('getExtra')->willReturn(array('helhum/class-alias-loader' => array('class-alias-maps' => array('path/map.php'))));
     $this->IOMock->expects($this->once())->method('writeError');
     $subject = new Config($this->packageMock, $this->IOMock);
     $this->assertSame(array('path/map.php'), $subject->get('class-alias-maps'));
 }
开发者ID:typo3,项目名称:class-alias-loader,代码行数:10,代码来源:ConfigTest.php

示例2: executeCommand

 /**
  * @param string $command
  * @param bool $decorated
  * @param \PHPUnit_Framework_MockObject_Matcher_Invocation|null $matcher
  */
 protected function executeCommand($command, $decorated, \PHPUnit_Framework_MockObject_Matcher_Invocation $matcher = null)
 {
     if ($decorated) {
         $command .= ' --ansi';
     }
     $this->io->expects($this->atLeastOnce())->method('isDecorated')->will($this->returnValue($decorated));
     $this->event_command->expects($this->atLeastOnce())->method('getIO')->will($this->returnValue($this->io));
     $this->container->expects($matcher ?: $this->once())->method('executeCommand')->with($command, 0);
 }
开发者ID:anime-db,项目名称:anime-db,代码行数:14,代码来源:ScriptHandlerTest.php

示例3: testRunPostAutoloadDumpOnlyOnce

 public function testRunPostAutoloadDumpOnlyOnce()
 {
     $listeners = $this->plugin->getSubscribedEvents();
     $this->assertArrayHasKey(ScriptEvents::POST_AUTOLOAD_DUMP, $listeners);
     $listener = $listeners[ScriptEvents::POST_AUTOLOAD_DUMP];
     $event = new CommandEvent(ScriptEvents::POST_AUTOLOAD_DUMP, $this->composer, $this->io);
     $this->io->expects($this->exactly(3))->method('write');
     $this->plugin->{$listener}($event);
     $this->plugin->{$listener}($event);
 }
开发者ID:kormik,项目名称:composer-plugin,代码行数:10,代码来源:PuliPluginTest.php

示例4: uninstallKeepSources

 /**
  * @test
  */
 public function uninstallKeepSources()
 {
     $this->io->expects($this->once())->method('askConfirmation')->willReturn(false);
     /** @var SymlinkFilesystem|\PHPUnit_Framework_MockObject_MockObject $filesystem */
     $filesystem = $this->getMock('\\LEtudiant\\Composer\\Util\\SymlinkFilesystem');
     $filesystem->expects($this->once())->method('removeSymlink')->willReturn(true);
     $installer = $this->createInstaller($this->config, $filesystem);
     $package = $this->createPackageMock();
     $this->repository->expects($this->once())->method('removePackage')->with($package);
     $this->dm->expects($this->never())->method('remove');
     $this->dataManager->expects($this->once())->method('removePackageUsage')->with($package);
     $installer->uninstall($this->repository, $package);
 }
开发者ID:letudiant,项目名称:composer-shared-package-plugin,代码行数:16,代码来源:SharedPackageInstallerTest.php

示例5: uninstallDevelopment

 /**
  * @test
  */
 public function uninstallDevelopment()
 {
     $this->io->expects($this->once())->method('askConfirmation')->willReturn(true);
     /** @var SymlinkFilesystem|\PHPUnit_Framework_MockObject_MockObject $filesystem */
     $filesystem = $this->getMock('\\LEtudiant\\Composer\\Util\\SymlinkFilesystem');
     $filesystem->expects($this->once())->method('removeSymlink')->willReturn(true);
     $library = new SharedPackageInstaller($this->io, $this->composer, $filesystem, $this->dataManager);
     $package = $this->createDevelopmentPackageMock();
     $this->repository->expects($this->exactly(1))->method('hasPackage')->with($package)->will($this->onConsecutiveCalls(true, true));
     $this->repository->expects($this->once())->method('removePackage')->with($package);
     $this->dm->expects($this->once())->method('remove')->with($package, $this->dependenciesDir . '/letudiant/foo-bar/dev-develop');
     $this->dataManager->expects($this->once())->method('removePackageUsage')->with($package);
     $library->uninstall($this->repository, $package);
 }
开发者ID:JasLin,项目名称:composer-shared-package-plugin,代码行数:17,代码来源:SharedPackageInstallerTest.php

示例6: configureExpectationsFor

 /**
  * Helper method for setting up the the expectations for the given $credentials.
  *
  * @param array $credentials
  */
 protected function configureExpectationsFor($credentials = array())
 {
     foreach ($credentials as $host => $config) {
         // satisfies the requirement that credentials without a username get ignored
         if (!isset($config['username'])) {
             continue;
         }
         // satisfies the requirement that not existing passwords will default to null
         if (!isset($config['password'])) {
             $config['password'] = null;
         }
         $this->io->expects($this->at($this->idx++))->method('setAuthentication')->with($host, $config['username'], $config['password']);
         $this->io->expects($this->at($this->idx++))->method('setAuthentication')->with('http://' . $host . '/packages.json', $config['username'], $config['password']);
         $this->io->expects($this->at($this->idx++))->method('setAuthentication')->with('https://' . $host . '/packages.json', $config['username'], $config['password']);
     }
 }
开发者ID:bitexpert,项目名称:composer-authstore-plugin,代码行数:21,代码来源:AuthStorePluginUnitTest.php


注:本文中的Composer\IO\IOInterface::expects方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。