<?php

//Mock::Generate('Wact_Template_Compiler_Attribute_Expression', 'MockExpressionTemplateAttribute');
Mock::Generate('Wact_Template_Compiler_Attribute', 'MockTemplateAttribute');
Mock::Generate('Wact_Template_Compiler_Node', 'MockTemplateNode');
//Mock::Generate('Wact_Php_Writer', 'MockCodeWriter');
//Mock::Generate('Expression', 'MockExpression');

/*
Mock::generatePartial(
        'Wact_Template_Compiler_Attribute_Expression',
        'ExpressionTemplateAttributePartialMock',
        array('createExpression'));
*/

class Wact_Template_Compiler_AttributeTestCase extends Wact_Test_Case {

    function setUp() {
        $this->attribute = new Wact_Template_Compiler_Attribute('test', 'value');
    }

    function tearDown() {
        unset ( $this->attribute );
        parent::tearDown();
    }
    
    function testIsConstant() {
        $this->assertTrue($this->attribute->isConstant());
    }
    
    function testGetValue() {
        $this->assertEqual($this->attribute->getValue(), 'value');
    }

    function testGetValueNull() {
        $attribute = new Wact_Template_Compiler_Attribute('test', NULL);
        $this->assertIdentical($attribute->getValue(), NULL);
    }

/*  
    function testGenerateFragment() {
        // BAD TEST: see bug #896626
        $code = new MockCodeWriter($this);
        $code->expectArguments('writeHTML', array('value'));
        $this->attribute->generateFragment($code);
    }
*/

/*  
    function testGenerate() {
        // BAD TEST: see bug #896626
        $code = new MockCodeWriter($this);
        $code->expectArgumentsAt(0, 'writeHTML', array(' test'));
        $code->expectArgumentsAt(1, 'writeHTML', array('="'));
        $code->expectArgumentsAt(2, 'writeHTML', array('value'));
        $code->expectArgumentsAt(3, 'writeHTML', array('"'));
        $this->attribute->generate($code);
    }
*/

/*
    function testGenerateExpression() {
        // BAD TEST: see bug #896626
        $code = new MockCodeWriter($this);
        $code->expectArguments('writePHPLiteral', array('value'));
        $this->attribute->generatePreStatement($code);
        $this->attribute->generateExpression($code);
        $this->attribute->generatePostStatement($code);
    }
*/

}

?>
