You are here

public function HelperSetTest::testSet 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::testSet()

@covers \Symfony\Component\Console\Helper\HelperSet::set

File

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

Class

HelperSetTest

Namespace

Symfony\Component\Console\Tests\Helper

Code

public function testSet() {
  $helperset = new HelperSet();
  $helperset
    ->set($this
    ->getGenericMockHelper('fake_helper', $helperset));
  $this
    ->assertTrue($helperset
    ->has('fake_helper'), '->set() adds helper to helpers');
  $helperset = new HelperSet();
  $helperset
    ->set($this
    ->getGenericMockHelper('fake_helper_01', $helperset));
  $helperset
    ->set($this
    ->getGenericMockHelper('fake_helper_02', $helperset));
  $this
    ->assertTrue($helperset
    ->has('fake_helper_01'), '->set() will set multiple helpers on consecutive calls');
  $this
    ->assertTrue($helperset
    ->has('fake_helper_02'), '->set() will set multiple helpers on consecutive calls');
  $helperset = new HelperSet();
  $helperset
    ->set($this
    ->getGenericMockHelper('fake_helper', $helperset), 'fake_helper_alias');
  $this
    ->assertTrue($helperset
    ->has('fake_helper'), '->set() adds helper alias when set');
  $this
    ->assertTrue($helperset
    ->has('fake_helper_alias'), '->set() adds helper alias when set');
}