Sha256: 9dbc3688de94d47f6a5fde31a14848eea36845d42b4f59251b101a01399edc67

Contents?: true

Size: 1.77 KB

Versions: 84

Compression:

Stored size: 1.77 KB

Contents

<?php

require "space-age.php";

class SpaceAgeTester extends PHPUnit_Framework_TestCase
{
    const DELTA = 0.01;

    public function testAgeInSeconds()
    {
        $age = new SpaceAge(1000000);
        $this->assertEquals(1000000, $age->seconds());
    }

    public function testAgeOnEarth()
    {
        $this->markTestSkipped();
        $age = new SpaceAge(1000000000);
        $this->assertEquals(31.69, $age->earth(), '', self::DELTA);
    }

    public function testAgeOnMercury()
    {
        $this->markTestSkipped();
        $age = new SpaceAge(2134835688);
        $this->assertEquals(280.88, $age->mercury(), '', self::DELTA);
    }

    public function testAgeOnVenus()
    {
        $this->markTestSkipped();
        $age = new SpaceAge(189839836);
        $this->assertEquals(9.78, $age->venus(), '', self::DELTA);
    }

    public function testAgeOnMars()
    {
        $this->markTestSkipped();
        $age = new SpaceAge(2329871239);
        $this->assertEquals(39.25, $age->mars(), '', self::DELTA);
    }

    public function testAgeOnJupiter()
    {
        $this->markTestSkipped();
        $age = new SpaceAge(901876382);
        $this->assertEquals(2.41, $age->jupiter(), '', self::DELTA);
    }

    public function testAgeOnSaturn()
    {
        $this->markTestSkipped();
        $age = new SpaceAge(3000000000);
        $this->assertEquals(3.23, $age->saturn(), '', self::DELTA);
    }

    public function testAgeOnUranus()
    {
        $this->markTestSkipped();
        $age = new SpaceAge(3210123456);
        $this->assertEquals(1.21, $age->uranus(), '', self::DELTA);
    }

    public function testAgeOnNeptune()
    {
        $this->markTestSkipped();
        $age = new SpaceAge(8210123456);
        $this->assertEquals(1.58, $age->neptune(), '', self::DELTA);
    }
}

Version data entries

84 entries across 84 versions & 1 rubygems

Version Path
trackler-2.0.6.40 tracks/php/exercises/space-age/space-age_test.php
trackler-2.0.6.39 tracks/php/exercises/space-age/space-age_test.php
trackler-2.0.6.38 tracks/php/exercises/space-age/space-age_test.php
trackler-2.0.6.37 tracks/php/exercises/space-age/space-age_test.php
trackler-2.0.6.36 tracks/php/exercises/space-age/space-age_test.php
trackler-2.0.6.35 tracks/php/exercises/space-age/space-age_test.php
trackler-2.0.6.34 tracks/php/exercises/space-age/space-age_test.php
trackler-2.0.6.33 tracks/php/exercises/space-age/space-age_test.php
trackler-2.0.6.32 tracks/php/exercises/space-age/space-age_test.php
trackler-2.0.6.31 tracks/php/exercises/space-age/space-age_test.php
trackler-2.0.6.30 tracks/php/exercises/space-age/space-age_test.php
trackler-2.0.6.29 tracks/php/exercises/space-age/space-age_test.php
trackler-2.0.6.28 tracks/php/exercises/space-age/space-age_test.php
trackler-2.0.6.27 tracks/php/exercises/space-age/space-age_test.php
trackler-2.0.6.26 tracks/php/exercises/space-age/space-age_test.php
trackler-2.0.6.25 tracks/php/exercises/space-age/space-age_test.php
trackler-2.0.6.24 tracks/php/exercises/space-age/space-age_test.php
trackler-2.0.6.23 tracks/php/exercises/space-age/space-age_test.php
trackler-2.0.6.22 tracks/php/exercises/space-age/space-age_test.php
trackler-2.0.6.21 tracks/php/exercises/space-age/space-age_test.php