-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathExampleUnitTest.php
50 lines (42 loc) · 1.2 KB
/
ExampleUnitTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
namespace Drupal\Tests\example\Unit;
use PHPUnit\Framework\TestCase;
/**
* Provides an example PHPUnit test for ORCA.
*/
class ExampleUnitTest extends TestCase {
/**
* Demonstrates designating a test to run only during own builds.
*/
public function testPrivatePseudoGroup(): void {
self::assertTrue(TRUE, 'Performed private test.');
}
/**
* Demonstrates designating a test to run during OTHER packages' builds.
*
* @group orca_public
*/
public function testPublicGroup(): void {
self::assertTrue(TRUE, 'Performed public test.');
}
/**
* Demonstrates designating a test to never run by ORCA.
*
* @group orca_ignore
*/
public function testIgnoreGroup(): void {
self::fail('Ran ignored test.');
}
/**
* Demonstrates ignoring deprecated code in test files.
*
* This function is private so that it will not be run by PHPUnit
* because this is only for static analysis.
*
* phpcs:disable DrupalPractice.Objects.UnusedPrivateMethod.UnusedMethod
*/
private function testDeprecateCodeInTestFiles(): void {
// This is a deprecated function which should not be caught by drupal-check.
file_create_url("https://example.com");
}
}