/**
  * (non-PHPdoc)
  * @see \Admingenerator\GeneratorBundle\Builder\BaseBuilder::getVariables()
  */
 public function getVariables()
 {
     // If credentials are not globally defined,
     // check if an action have credentials
     if (null === $this->getVariable('credentials')) {
         $this->variables->set('credentials', false);
         foreach (array_merge(array_values($this->getObjectActions()), array_values($this->getBatchActions())) as $action) {
             if ($action->getCredentials()) {
                 $this->variables->set('credentials', true);
                 break;
             }
         }
     }
     return parent::getVariables();
 }
 public function testSetVariables()
 {
     $builder = new BaseBuilder();
     $builder->setVariables(array('foo' => 'bar'));
     $this->assertEquals(array('foo' => 'bar'), $builder->getVariables(), 'setVariables accept an array');
 }