Sha256: 16e7ae672d138e95e37ae1c133a0c4a3f6d0450e2b77eb3d0d877d5e3c38e1ba

Contents?: true

Size: 1.37 KB

Versions: 10

Compression:

Stored size: 1.37 KB

Contents

<?php

namespace MtHaml\Tests;

require_once __DIR__ . '/TestCase.php';

class TestCaseTest extends TestCase
{
    public function testAssertExceptionReturnsIfNothingExceptedAndThrown()
    {
        $this->assertException(array(), null);
    }

    /**
     * @expectedException LogicException
     */
    public function testAssertExceptionThrowsIfNothingExpectedButThrown()
    {
        $e = new \LogicException;
        $this->assertException(array(), $e);
    }

    /**
     * @expectedException PHPUnit_Framework_ExpectationFailedException
     * @expectedExceptionMessage Failed asserting that exception of type "Foo"
     */
    public function testAssertExceptionFailsIfExpectedButNothingThrown()
    {
        $this->assertException(array('EXCEPTION' => "Foo\n"), null);
    }

    /**
     * @expectedException LogicException
     */
    public function testAssertExceptionThrowsIfWrongExceptionClass()
    {
        $e = new \LogicException;
        $this->assertException(array('EXCEPTION' => "Foo\n"), $e);
    }

    /**
     * @expectedException PHPUnit_Framework_ExpectationFailedException
     * @expectedExceptionMessage Failed asserting that 'foo' matches PCRE pattern "~^(bar)$~".
     */
    public function testAssertExceptionFailsIfMessageDoesNotMatch()
    {
        $e = new \Exception('foo');
        $this->assertException(array('EXCEPTION' => "Exception\nbar"), $e);
    }
}

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
guard-mthaml-0.4.0 vendor/mthaml/mthaml/test/MtHaml/Tests/TestCaseTest.php
guard-mthaml-0.3.1 vendor/mthaml/mthaml/test/MtHaml/Tests/TestCaseTest.php
guard-mthaml-0.3.0 vendor/mthaml/mthaml/test/MtHaml/Tests/TestCaseTest.php
guard-mthaml-0.2.5 vendor/mthaml/mthaml/test/MtHaml/Tests/TestCaseTest.php
guard-mthaml-0.2.4 vendor/mthaml/mthaml/test/MtHaml/Tests/TestCaseTest.php
guard-mthaml-0.2.3 vendor/mthaml/mthaml/test/MtHaml/Tests/TestCaseTest.php
guard-mthaml-0.2.2 vendor/mthaml/mthaml/test/MtHaml/Tests/TestCaseTest.php
guard-mthaml-0.2.1 vendor/mthaml/mthaml/test/MtHaml/Tests/TestCaseTest.php
guard-mthaml-0.2.0 vendor/mthaml/mthaml/test/MtHaml/Tests/TestCaseTest.php
guard-mthaml-0.1.0 vendor/mthaml/mthaml/test/MtHaml/Tests/TestCaseTest.php