mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
feat: toHavePrivateMethodsBesides, toHaveProtectedMethodsBesides, toHavePublicMethodsBesides
This commit is contained in:
12
tests/Features/Expect/toHavePrivateMethodsBesides.php
Normal file
12
tests/Features/Expect/toHavePrivateMethodsBesides.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
use Pest\Arch\Exceptions\ArchExpectationFailedException;
|
||||
use Tests\Fixtures\Arch\ToHavePublicMethodsBesides\UserController;
|
||||
|
||||
test('pass', function () {
|
||||
expect(UserController::class)->not->toHavePrivateMethodsBesides(['privateMethod']);
|
||||
});
|
||||
|
||||
test('failures', function () {
|
||||
expect(UserController::class)->not->toHavePrivateMethodsBesides([]);
|
||||
})->throws(ArchExpectationFailedException::class);
|
||||
12
tests/Features/Expect/toHaveProtectedMethodsBesides.php
Normal file
12
tests/Features/Expect/toHaveProtectedMethodsBesides.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
use Pest\Arch\Exceptions\ArchExpectationFailedException;
|
||||
use Tests\Fixtures\Arch\ToHavePublicMethodsBesides\UserController;
|
||||
|
||||
test('pass', function () {
|
||||
expect(UserController::class)->not->toHaveProtectedMethodsBesides(['protectedMethod']);
|
||||
});
|
||||
|
||||
test('failures', function () {
|
||||
expect(UserController::class)->not->toHaveProtectedMethodsBesides([]);
|
||||
})->throws(ArchExpectationFailedException::class);
|
||||
12
tests/Features/Expect/toHavePublicMethodsBesides.php
Normal file
12
tests/Features/Expect/toHavePublicMethodsBesides.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
use Pest\Arch\Exceptions\ArchExpectationFailedException;
|
||||
use Tests\Fixtures\Arch\ToHavePublicMethodsBesides\UserController;
|
||||
|
||||
test('pass', function () {
|
||||
expect(UserController::class)->not->toHavePublicMethodsBesides(['publicMethod']);
|
||||
});
|
||||
|
||||
test('failures', function () {
|
||||
expect(UserController::class)->not->toHavePublicMethodsBesides([]);
|
||||
})->throws(ArchExpectationFailedException::class);
|
||||
Reference in New Issue
Block a user