Guest User

Giorgio Sironi

a guest
Sep 25th, 2009
460
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. class AssertionsTest extends PHPUnit_Framework_TestCase
  4. {
  5.     public function testAssertionsMethodsWorksWithCorrectArguments()
  6.     {
  7.         $this->assertTrue(1 == 1);
  8.         $this->assertTrue(true);
  9.         $this->assertFalse(false);
  10.         $this->assertFalse(0 == 1);
  11.  
  12.         $this->assertEquals('foo', 'foo');
  13.         $this->assertEquals(1, "1");
  14.         $this->assertNotEquals(1, 2);
  15.         $this->assertSame(1, 1);
  16.         $this->assertNotSame(1, "1");
  17.  
  18.         $this->assertContains('foo', array('foo', 'otherValue'));
  19.         $this->assertContains('foo', new ArrayIterator(array('foo', 'otherValue')));
  20.         $this->assertNotContains('foo', array('otherValue'));
  21.         $this->assertContainsOnly('string', array('foo', 'otherValue'));
  22.  
  23.         $this->assertArrayHasKey(0, array('foo'));
  24.         $this->assertArrayHasKey('foo', array('foo' => 'bar', 'otherValue'));
  25.     }
  26. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×