Skip to content

Instantly share code, notes, and snippets.

@jeremyharris
Created November 8, 2016 21:30
Show Gist options
  • Save jeremyharris/99a0b59e8df57846a18de6f710f727c7 to your computer and use it in GitHub Desktop.
Save jeremyharris/99a0b59e8df57846a18de6f710f727c7 to your computer and use it in GitHub Desktop.

Revisions

  1. jeremyharris created this gist Nov 8, 2016.
    22 changes: 22 additions & 0 deletions AssertionTest.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    <?php

    class CallbackCaller
    {
    public function on($callback)
    {
    // whoops doesn't fire, perhaps due to code error
    }
    }

    class AssertionTest extends \PHPUnit_Framework_TestCase
    {
    public function testAssertionInCallback()
    {
    $class = new CallbackCaller();
    $class->on(function() {
    $this->assertTrue(false);
    });

    $this->assertTrue(true);
    }
    }