You are here

private function HelperSetTest::getGenericMockHelper in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Tests/Helper/HelperSetTest.php \Symfony\Component\Console\Tests\Helper\HelperSetTest::getGenericMockHelper()

Create a generic mock for the helper interface. Optionally check for a call to setHelperSet with a specific helperset instance.

Parameters

string $name:

HelperSet $helperset allows a mock to verify a particular helperset set is being added to the Helper:

5 calls to HelperSetTest::getGenericMockHelper()
HelperSetTest::testConstructor in vendor/symfony/console/Tests/Helper/HelperSetTest.php
@covers \Symfony\Component\Console\Helper\HelperSet::__construct
HelperSetTest::testGet in vendor/symfony/console/Tests/Helper/HelperSetTest.php
@covers \Symfony\Component\Console\Helper\HelperSet::get
HelperSetTest::testHas in vendor/symfony/console/Tests/Helper/HelperSetTest.php
@covers \Symfony\Component\Console\Helper\HelperSet::has
HelperSetTest::testIteration in vendor/symfony/console/Tests/Helper/HelperSetTest.php
@covers \Symfony\Component\Console\Helper\HelperSet::getIterator
HelperSetTest::testSet in vendor/symfony/console/Tests/Helper/HelperSetTest.php
@covers \Symfony\Component\Console\Helper\HelperSet::set

File

vendor/symfony/console/Tests/Helper/HelperSetTest.php, line 138

Class

HelperSetTest

Namespace

Symfony\Component\Console\Tests\Helper

Code

private function getGenericMockHelper($name, HelperSet $helperset = null) {
  $mock_helper = $this
    ->getMock('\\Symfony\\Component\\Console\\Helper\\HelperInterface');
  $mock_helper
    ->expects($this
    ->any())
    ->method('getName')
    ->will($this
    ->returnValue($name));
  if ($helperset) {
    $mock_helper
      ->expects($this
      ->any())
      ->method('setHelperSet')
      ->with($this
      ->equalTo($helperset));
  }
  return $mock_helper;
}