<?php

class BMAttackSurrenderTest extends PHPUnit_Framework_TestCase {
    /**
     * @var BMAttackSurrender
     */
    protected $object;

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    protected function setUp()
    {
        $this->object = BMAttackSurrender::get_instance();
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     */
    protected function tearDown()
    {
    }

    /**
     * @covers BMAttackSurrender::validate_attack
     */
    public function testValidate_attack()
    {
//        $game = new TestDummyGame;
//
//        $die1 = new BMDie;
//        $die1->init(6);
//        $die1->value = 6;
//
//        $die2 = new BMDie;
//        $die2->init(6);
//        $die2->value = 1;
//
//        // Basic error handling
//        $this->assertTrue($this->object->validate_attack($game, array(), array()));
//        $this->assertFalse($this->object->validate_attack($game, array($die1), array()));
//        $this->assertFalse($this->object->validate_attack($game, array(), array($die1)));
//        $this->assertFalse($this->object->validate_attack($game, array($die1), array($die2)));
    }
}

?>
<?php

class BMAttackSurrenderTest extends PHPUnit_Framework_TestCase {
    /**
     * @var BMAttackSurrender
     */
    protected $object;

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    protected function setUp()
    {
        $this->object = BMAttackSurrender::get_instance();
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     */
    protected function tearDown()
    {
    }

    /**
     * @covers BMAttackSurrender::validate_attack
     */
    public function testValidate_attack()
    {
        $game = new TestDummyGame;

        $die1 = new BMDie;
        $die1->init(6);
        $die1->value = 6;

        $die2 = new BMDie;
        $die2->init(6);
        $die2->value = 1;

        // Basic error handling
        $this->assertTrue($this->object->validate_attack($game, array(), array()));
        $this->assertFalse($this->object->validate_attack($game, array($die1), array()));
        $this->assertFalse($this->object->validate_attack($game, array(), array($die1)));
        $this->assertFalse($this->object->validate_attack($game, array($die1), array($die2)));
    }
}

?>
Add basic unit tests for BMAttackSurrender
Add basic unit tests for BMAttackSurrender