Exemplo n.º 1
0
    function test_ReturnValuesManger_setConstants()
    {
        $rvm = new ReturnValuesManager('classe_con_costanti');
        $rvm->setConstant('NAME', 'name');
        $rvm->setConstant('DB', 'db');
        $rvm->setConstant('PIPPO', 'pippo');
        $this->assertTrue(is_array($rvm->getConstants()), '->getConstants() return an array');
        $constants = $rvm->getConstants();
        $this->assertTrue(isset($constants['NAME']), '->getConstants() has set the right value');
        $this->assertEqual($constants['NAME'], 'name', '->getConstants() return the right value for costant');
        $this->assertTrue(isset($constants['DB']), '->getConstants() has set the right value');
        $this->assertEqual($constants['DB'], 'db', '->getConstants() return the right value for costant');
        $this->assertTrue(isset($constants['PIPPO']), '->getConstants() has set the right value');
        $this->assertEqual($constants['PIPPO'], 'pippo', '->getConstants() return the right value for costant');
        $this->assertEqual($rvm->returnCodeForReturnValueManager($rvm), '        $rvm_classe_con_costanti = new ReturnValuesManager(\'classe_con_costanti\');
        $rvm_classe_con_costanti->setConstant(NAME, name);
        $rvm_classe_con_costanti->setConstant(DB, db);
        $rvm_classe_con_costanti->setConstant(PIPPO, pippo);
');
    }