class ResourceComparatorTest in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/sebastian/comparator/tests/ResourceComparatorTest.php \SebastianBergmann\Comparator\ResourceComparatorTest
@coversDefaultClass SebastianBergmann\Comparator\ResourceComparator
Hierarchy
- class \SebastianBergmann\Comparator\ResourceComparatorTest extends \SebastianBergmann\Comparator\PHPUnit_Framework_TestCase
Expanded class hierarchy of ResourceComparatorTest
File
- vendor/sebastian/ comparator/ tests/ ResourceComparatorTest.php, line 17 
Namespace
SebastianBergmann\ComparatorView source
class ResourceComparatorTest extends \PHPUnit_Framework_TestCase {
  private $comparator;
  protected function setUp() {
    $this->comparator = new ResourceComparator();
  }
  public function acceptsSucceedsProvider() {
    $tmpfile1 = tmpfile();
    $tmpfile2 = tmpfile();
    return array(
      array(
        $tmpfile1,
        $tmpfile1,
      ),
      array(
        $tmpfile2,
        $tmpfile2,
      ),
      array(
        $tmpfile1,
        $tmpfile2,
      ),
    );
  }
  public function acceptsFailsProvider() {
    $tmpfile1 = tmpfile();
    return array(
      array(
        $tmpfile1,
        null,
      ),
      array(
        null,
        $tmpfile1,
      ),
      array(
        null,
        null,
      ),
    );
  }
  public function assertEqualsSucceedsProvider() {
    $tmpfile1 = tmpfile();
    $tmpfile2 = tmpfile();
    return array(
      array(
        $tmpfile1,
        $tmpfile1,
      ),
      array(
        $tmpfile2,
        $tmpfile2,
      ),
    );
  }
  public function assertEqualsFailsProvider() {
    $tmpfile1 = tmpfile();
    $tmpfile2 = tmpfile();
    return array(
      array(
        $tmpfile1,
        $tmpfile2,
      ),
      array(
        $tmpfile2,
        $tmpfile1,
      ),
    );
  }
  /**
   * @covers       ::accepts
   * @dataProvider acceptsSucceedsProvider
   */
  public function testAcceptsSucceeds($expected, $actual) {
    $this
      ->assertTrue($this->comparator
      ->accepts($expected, $actual));
  }
  /**
   * @covers       ::accepts
   * @dataProvider acceptsFailsProvider
   */
  public function testAcceptsFails($expected, $actual) {
    $this
      ->assertFalse($this->comparator
      ->accepts($expected, $actual));
  }
  /**
   * @covers       ::assertEquals
   * @dataProvider assertEqualsSucceedsProvider
   */
  public function testAssertEqualsSucceeds($expected, $actual) {
    $exception = null;
    try {
      $this->comparator
        ->assertEquals($expected, $actual);
    } catch (ComparisonFailure $exception) {
    }
    $this
      ->assertNull($exception, 'Unexpected ComparisonFailure');
  }
  /**
   * @covers       ::assertEquals
   * @dataProvider assertEqualsFailsProvider
   */
  public function testAssertEqualsFails($expected, $actual) {
    $this
      ->setExpectedException('SebastianBergmann\\Comparator\\ComparisonFailure');
    $this->comparator
      ->assertEquals($expected, $actual);
  }
}Members
| Name   | Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| ResourceComparatorTest:: | private | property | ||
| ResourceComparatorTest:: | public | function | ||
| ResourceComparatorTest:: | public | function | ||
| ResourceComparatorTest:: | public | function | ||
| ResourceComparatorTest:: | public | function | ||
| ResourceComparatorTest:: | protected | function | ||
| ResourceComparatorTest:: | public | function | @covers ::accepts @dataProvider acceptsFailsProvider | |
| ResourceComparatorTest:: | public | function | @covers ::accepts @dataProvider acceptsSucceedsProvider | |
| ResourceComparatorTest:: | public | function | @covers ::assertEquals @dataProvider assertEqualsFailsProvider | |
| ResourceComparatorTest:: | public | function | @covers ::assertEquals @dataProvider assertEqualsSucceedsProvider | 
