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


PHP PHPUnit_Framework_MockObject_MockObject::getVersion方法代码示例

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


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

示例1: testGetVersion

 /**
  * @dataProvider getVersionDataProvider
  */
 public function testGetVersion($versionCmdOutput, $expectedVersion)
 {
     $cmdCallback = function ($shellCmd, array &$output = null) use($versionCmdOutput) {
         $output = array($versionCmdOutput);
         return !empty($shellCmd);
     };
     $this->_cmd->expects($this->once())->method('_execShellCmd')->with($this->stringContains('phpmd'))->will($this->returnCallback($cmdCallback));
     $this->assertEquals($expectedVersion, $this->_cmd->getVersion());
 }
开发者ID:natxetee,项目名称:magento2,代码行数:12,代码来源:CommandTest.php

示例2: testTagWithTransportException

    /**
     * @param string $type
     * @param bool   $verbose
     * @param string $exceptionClass
     * @param string $validTrace
     *
     * @dataProvider getConfigIoForException
     */
    public function testTagWithTransportException($type, $verbose, $exceptionClass, $validTrace)
    {
        /* @var \PHPUnit_Framework_MockObject_MockObject $loader */
        $loader = $this->loader;
        $loader
            ->expects($this->any())
            ->method('load')
            ->will($this->throwException(new $exceptionClass('MESSAGE')));

        $this->lazyLoader = $this->createLazyLoaderConfigured($type, $verbose);
        $package = $this->lazyLoader->load($this->lazyPackage);

        $this->assertFalse($package);

        $filename = $this->assetType->getFilename();
        $validOutput = array('');

        if ($verbose) {
            $validOutput = array(
                'Reading ' . $filename . ' of <info>' . $this->lazyPackage->getName() . '</info> (<comment>' . $this->lazyPackage->getPrettyVersion() . '</comment>)',
                'Importing empty ' . $type . ' ' . $this->lazyPackage->getPrettyVersion() . ' (' . $this->lazyPackage->getVersion() . ')',
                $validTrace,
                '',
            );
        }
        $this->assertSame($validOutput, $this->io->getTraces());

        $packageCache = $this->lazyLoader->load($this->lazyPackage);
        $this->assertFalse($packageCache);
        $this->assertSame($validOutput, $this->io->getTraces());
    }
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:39,代码来源:LazyAssetPackageLoaderTest.php

示例3: testGetPackageCopy

 public function testGetPackageCopy()
 {
     $this->initJob([], $this->atLeastOnce());
     $this->package->expects($this->atLeastOnce())->method('getName')->will($this->returnValue('foo/bar'));
     $this->package->expects($this->atLeastOnce())->method('getVersion')->will($this->returnValue('1.0.0'));
     $this->package->expects($this->atLeastOnce())->method('getPrettyVersion')->will($this->returnValue('1'));
     $this->package->expects($this->atLeastOnce())->method('getType')->will($this->returnValue('lib'));
     $copy = $this->job->getPackageCopy();
     // test
     $this->assertInstanceOf('\\Composer\\Package\\Package', $copy);
     $this->assertEquals($this->package->getName(), $copy->getName());
     $this->assertEquals($this->package->getVersion(), $copy->getVersion());
     $this->assertEquals($this->package->getPrettyVersion(), $copy->getPrettyVersion());
     $this->assertEquals($this->package->getType(), $copy->getType());
     $this->assertEquals($this->package->getExtra(), $copy->getExtra());
 }
开发者ID:anime-db,项目名称:anime-db,代码行数:16,代码来源:JobTest.php

示例4: testGetVersion

 /**
  * @dataProvider getVersionDataProvider
  */
 public function testGetVersion($versionCmdOutput, $expectedVersion)
 {
     $this->_cmd->expects($this->once())->method('_execShellCmd')->with($this->stringContains('phpmd'))->will($this->returnValue($versionCmdOutput));
     $this->assertEquals($expectedVersion, $this->_cmd->getVersion());
 }
开发者ID:nemphys,项目名称:magento2,代码行数:8,代码来源:CommandTest.php


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