@@ -858,6 +858,8 @@ public function testAssertIsReadable(): void
858
858
859
859
public function testAssertNotIsReadable (): void
860
860
{
861
+ $ this ->assertNotIsReadable (__DIR__ . \DIRECTORY_SEPARATOR . 'NotExisting ' );
862
+
861
863
$ this ->expectException (AssertionFailedError::class);
862
864
863
865
$ this ->assertNotIsReadable (__FILE__ );
@@ -874,6 +876,8 @@ public function testAssertIsWritable(): void
874
876
875
877
public function testAssertNotIsWritable (): void
876
878
{
879
+ $ this ->assertNotIsWritable (__DIR__ . \DIRECTORY_SEPARATOR . 'NotExisting ' );
880
+
877
881
$ this ->expectException (AssertionFailedError::class);
878
882
879
883
$ this ->assertNotIsWritable (__FILE__ );
@@ -1596,27 +1600,55 @@ public function testAssertClassHasAttributeThrowsExceptionIfAttributeNameIsNotVa
1596
1600
$ this ->assertClassHasAttribute ('1 ' , \ClassWithNonPublicAttributes::class);
1597
1601
}
1598
1602
1603
+ public function testAssertClassHasAttributeThrowsExceptionIfClassDoesNotExist (): void
1604
+ {
1605
+ $ this ->expectException (Exception::class);
1606
+
1607
+ $ this ->assertClassHasAttribute ('attribute ' , 'ClassThatDoesNotExist ' );
1608
+ }
1609
+
1599
1610
public function testAssertClassNotHasAttributeThrowsExceptionIfAttributeNameIsNotValid (): void
1600
1611
{
1601
1612
$ this ->expectException (Exception::class);
1602
1613
1603
1614
$ this ->assertClassNotHasAttribute ('1 ' , \ClassWithNonPublicAttributes::class);
1604
1615
}
1605
1616
1617
+ public function testAssertClassNotHasAttributeThrowsExceptionIfClassDoesNotExist (): void
1618
+ {
1619
+ $ this ->expectException (Exception::class);
1620
+
1621
+ $ this ->assertClassNotHasAttribute ('attribute ' , 'ClassThatDoesNotExist ' );
1622
+ }
1623
+
1606
1624
public function testAssertClassHasStaticAttributeThrowsExceptionIfAttributeNameIsNotValid (): void
1607
1625
{
1608
1626
$ this ->expectException (Exception::class);
1609
1627
1610
1628
$ this ->assertClassHasStaticAttribute ('1 ' , \ClassWithNonPublicAttributes::class);
1611
1629
}
1612
1630
1631
+ public function testAssertClassHasStaticAttributeThrowsExceptionIfClassDoesNotExist (): void
1632
+ {
1633
+ $ this ->expectException (Exception::class);
1634
+
1635
+ $ this ->assertClassHasStaticAttribute ('attribute ' , 'ClassThatDoesNotExist ' );
1636
+ }
1637
+
1613
1638
public function testAssertClassNotHasStaticAttributeThrowsExceptionIfAttributeNameIsNotValid (): void
1614
1639
{
1615
1640
$ this ->expectException (Exception::class);
1616
1641
1617
1642
$ this ->assertClassNotHasStaticAttribute ('1 ' , \ClassWithNonPublicAttributes::class);
1618
1643
}
1619
1644
1645
+ public function testAssertClassNotHasStaticAttributeThrowsExceptionIfClassDoesNotExist (): void
1646
+ {
1647
+ $ this ->expectException (Exception::class);
1648
+
1649
+ $ this ->assertClassNotHasStaticAttribute ('attribute ' , 'ClassThatDoesNotExist ' );
1650
+ }
1651
+
1620
1652
public function testAssertObjectHasAttributeThrowsException2 (): void
1621
1653
{
1622
1654
$ this ->expectException (Exception::class);
@@ -2411,6 +2443,13 @@ public function testAssertJsonFileEqualsJsonFile(): void
2411
2443
$ this ->assertJsonFileEqualsJsonFile ($ file , $ file , $ message );
2412
2444
}
2413
2445
2446
+ public function testAssertInstanceOfThrowsExceptionIfTypeDoesNotExist (): void
2447
+ {
2448
+ $ this ->expectException (Exception::class);
2449
+
2450
+ $ this ->assertInstanceOf ('ClassThatDoesNotExist ' , new \stdClass );
2451
+ }
2452
+
2414
2453
public function testAssertInstanceOf (): void
2415
2454
{
2416
2455
$ this ->assertInstanceOf (\stdClass::class, new \stdClass );
@@ -2428,6 +2467,13 @@ public function testAssertAttributeInstanceOf(): void
2428
2467
$ this ->assertAttributeInstanceOf (\stdClass::class, 'a ' , $ o );
2429
2468
}
2430
2469
2470
+ public function testAssertNotInstanceOfThrowsExceptionIfTypeDoesNotExist (): void
2471
+ {
2472
+ $ this ->expectException (Exception::class);
2473
+
2474
+ $ this ->assertNotInstanceOf ('ClassThatDoesNotExist ' , new \stdClass );
2475
+ }
2476
+
2431
2477
public function testAssertNotInstanceOf (): void
2432
2478
{
2433
2479
$ this ->assertNotInstanceOf (\Exception::class, new \stdClass );
@@ -2520,6 +2566,69 @@ public function testAssertStringNotMatchesFormatFile(): void
2520
2566
$ this ->assertStringNotMatchesFormatFile (TEST_FILES_PATH . 'expectedFileFormat.txt ' , "FOO \n" );
2521
2567
}
2522
2568
2569
+ public function testLogicalAnd (): void
2570
+ {
2571
+ $ this ->assertThat (
2572
+ true ,
2573
+ $ this ->logicalAnd (
2574
+ $ this ->isTrue (),
2575
+ $ this ->isTrue ()
2576
+ )
2577
+ );
2578
+
2579
+ $ this ->expectException (AssertionFailedError::class);
2580
+
2581
+ $ this ->assertThat (
2582
+ true ,
2583
+ $ this ->logicalAnd (
2584
+ $ this ->isTrue (),
2585
+ $ this ->isFalse ()
2586
+ )
2587
+ );
2588
+ }
2589
+
2590
+ public function testLogicalOr (): void
2591
+ {
2592
+ $ this ->assertThat (
2593
+ true ,
2594
+ $ this ->logicalOr (
2595
+ $ this ->isTrue (),
2596
+ $ this ->isFalse ()
2597
+ )
2598
+ );
2599
+
2600
+ $ this ->expectException (AssertionFailedError::class);
2601
+
2602
+ $ this ->assertThat (
2603
+ true ,
2604
+ $ this ->logicalOr (
2605
+ $ this ->isFalse (),
2606
+ $ this ->isFalse ()
2607
+ )
2608
+ );
2609
+ }
2610
+
2611
+ public function testLogicalXor (): void
2612
+ {
2613
+ $ this ->assertThat (
2614
+ true ,
2615
+ $ this ->logicalXor (
2616
+ $ this ->isTrue (),
2617
+ $ this ->isFalse ()
2618
+ )
2619
+ );
2620
+
2621
+ $ this ->expectException (AssertionFailedError::class);
2622
+
2623
+ $ this ->assertThat (
2624
+ true ,
2625
+ $ this ->logicalXor (
2626
+ $ this ->isTrue (),
2627
+ $ this ->isTrue ()
2628
+ )
2629
+ );
2630
+ }
2631
+
2523
2632
protected function sameValues (): array
2524
2633
{
2525
2634
$ object = new \SampleClass (4 , 8 , 15 );
0 commit comments