Sha256: 8f584648d11d4a67b3061f06deb3a17ae1d745aa1f5d4ae713884bff749ac4ef

Contents?: true

Size: 1.06 KB

Versions: 29

Compression:

Stored size: 1.06 KB

Contents

<?php

require_once "robot-name.php";

class RobotTest extends PHPUnit_Framework_TestCase
{
    /** @var Robot $robot */
    protected $robot = null;

    public function setUp()
    {
        $this->robot = new Robot();
    }

    public function testHasName()
    {
        $this->assertRegExp('/^[a-z]{2}\d{3}$/i', $this->robot->getName());
    }

    public function testNameSticks()
    {
        $this->markTestSkipped();
        $old = $this->robot->getName();

        $this->assertSame($this->robot->getName(), $old);
    }

    public function testDifferentRobotsHaveDifferentNames()
    {
        $this->markTestSkipped();
        $other_bot = new Robot();

        $this->assertNotSame($other_bot->getName(), $this->robot->getName());

        unset($other_bot);
    }

    public function testresetName()
    {
        $this->markTestSkipped();
        $name1 = $this->robot->getName();

        $this->robot->reset();

        $name2 = $this->robot->getName();

        $this->assertNotSame($name1, $name2);

        $this->assertRegExp('/\w{2}\d{3}/', $name2);
    }
}

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
trackler-2.0.3.3 tracks/php/exercises/robot-name/robot-name_test.php
trackler-2.0.3.2 tracks/php/exercises/robot-name/robot-name_test.php
trackler-2.0.3.1 tracks/php/exercises/robot-name/robot-name_test.php
trackler-2.0.3.0 tracks/php/exercises/robot-name/robot-name_test.php
trackler-2.0.2.0 tracks/php/exercises/robot-name/robot-name_test.php
trackler-2.0.1.2 tracks/php/exercises/robot-name/robot-name_test.php
trackler-2.0.1.1 tracks/php/exercises/robot-name/robot-name_test.php
trackler-2.0.1.0 tracks/php/exercises/robot-name/robot-name_test.php
trackler-2.0.0.10 tracks/php/exercises/robot-name/robot-name_test.php
trackler-2.0.0.9 tracks/php/exercises/robot-name/robot-name_test.php
trackler-2.0.0.8 tracks/php/exercises/robot-name/robot-name_test.php
trackler-2.0.0.7 tracks/php/exercises/robot-name/robot-name_test.php
trackler-2.0.0.6 tracks/php/exercises/robot-name/robot-name_test.php
trackler-2.0.0.5 tracks/php/exercises/robot-name/robot-name_test.php
trackler-2.0.0.4 tracks/php/exercises/robot-name/robot-name_test.php
trackler-2.0.0.3 tracks/php/exercises/robot-name/robot-name_test.php
trackler-2.0.0.2 tracks/php/exercises/robot-name/robot-name_test.php
trackler-2.0.0.1 tracks/php/exercises/robot-name/robot-name_test.php
trackler-2.0.0.0 tracks/php/exercises/robot-name/robot-name_test.php
trackler-1.0.4.1 tracks/php/exercises/robot-name/robot-name_test.php