Skip to content

Instantly share code, notes, and snippets.

@sotarok
Created December 18, 2009 06:16
Show Gist options
  • Select an option

  • Save sotarok/259325 to your computer and use it in GitHub Desktop.

Select an option

Save sotarok/259325 to your computer and use it in GitHub Desktop.
<?php
/**
*
*/
function ae($a, $b)
{
$c = debug_backtrace();
$c[1]['object']->assertEquals($a, $b);
}
class ClassTest
{
public function __construct()
{
}
public function assertEquals($a, $b)
{
if ($a == $b) {
echo '.', PHP_EOL;
}
else {
echo 'E', PHP_EOL;
}
}
public function testHoge()
{
ae(1, 2);
}
}
$s = new ClassTest();
$s->testHoge();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment