Skip to content

Commit 9888452

Browse files
committed
Add test
1 parent c5cb336 commit 9888452

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

Diff for: phpunit.xml.dist

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
5+
backupGlobals="false"
6+
backupStaticAttributes="false"
7+
bootstrap="vendor/autoload.php"
8+
colors="true"
9+
convertErrorsToExceptions="true"
10+
convertNoticesToExceptions="true"
11+
convertWarningsToExceptions="true"
12+
processIsolation="false"
13+
stopOnFailure="false"
14+
executionOrder="random"
15+
failOnWarning="true"
16+
failOnRisky="true"
17+
failOnEmptyTestSuite="true"
18+
beStrictAboutOutputDuringTests="true"
19+
verbose="true"
20+
>
21+
<testsuites>
22+
<testsuite name="VendorName Test Suite">
23+
<directory>tests</directory>
24+
</testsuite>
25+
</testsuites>
26+
<coverage>
27+
<include>
28+
<directory suffix=".php">./src</directory>
29+
</include>
30+
<report>
31+
<html outputDirectory="build/coverage"/>
32+
<text outputFile="build/coverage.txt"/>
33+
<clover outputFile="build/logs/clover.xml"/>
34+
</report>
35+
</coverage>
36+
<logging>
37+
<junit outputFile="build/report.junit.xml"/>
38+
</logging>
39+
</phpunit>

Diff for: tests/ExampleTest.php

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
namespace :vendor_namespace\:package_class_name\Tests;
4+
5+
use PHPUnit\Framework\TestCase;
6+
use :vendor_namespace\:package_class_name\:package_class_name;
7+
8+
class :package_class_nameTest extends TestCase
9+
{
10+
/** @test */
11+
12+
public function it_can_getPackageDetail()
13+
{
14+
$array = (new :package_class_name)->getPackageDetail();
15+
16+
$this->assertEquals([
17+
'author' => [
18+
'name' => ':author_name',
19+
'username' => ':author_username',
20+
'email' => ':author_email',
21+
],
22+
'vendor' => [
23+
'name' => ':vendor_name',
24+
'slug' => ':vendor_slug',
25+
],
26+
'package' => [
27+
'name' => ':package_name',
28+
'slug' => ':package_slug',
29+
'description' => ':package_description',
30+
],
31+
], $array);
32+
}
33+
34+
}

0 commit comments

Comments
 (0)