Example #1
0
 /**
  * @covers CSanquer\FakeryGenerator\Model\Config::addVariable
  * @covers CSanquer\FakeryGenerator\Model\Config::getVariable
  * @covers CSanquer\FakeryGenerator\Model\Config::removeVariable
  * @covers CSanquer\FakeryGenerator\Model\Config::countVariables
  */
 public function testAddGetRemoveVariable()
 {
     $this->config->setFakerConfig($this->fakerConfig);
     $variable = new Variable('firstname', 'firstname');
     $this->assertInstanceOf('\\CSanquer\\FakeryGenerator\\Model\\Config', $this->config->addVariable($variable));
     $this->assertSame($variable, $this->config->getVariable('firstname'));
     $this->assertSame($this->config->getFakerConfig(), $this->config->getVariable('firstname')->getFakerConfig());
     $this->assertEquals(1, $this->config->countVariables());
     $this->assertTrue($this->config->removeVariable($variable));
     $this->assertEquals(0, $this->config->countVariables());
     $this->assertNull($this->config->getVariable('firstname'));
     $this->assertFalse($this->config->removeVariable($variable));
 }