add PHP boilerplate
This commit is contained in:
parent
7007922739
commit
5512a19e1f
|
|
@ -0,0 +1,9 @@
|
|||
/tmp/
|
||||
|
||||
# Editors
|
||||
.vscode
|
||||
.idea
|
||||
|
||||
# PHP
|
||||
/vendor/
|
||||
/coverage/
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
# NoteCat
|
||||
|
||||
Note taking app, similar to Evernote.
|
||||
|
||||
"Like Notepad, but meow!"
|
||||
Note taking app, similar to Evernote.
|
||||
|
||||
"Like Notepad, but meow!"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "binarydiv/notecat",
|
||||
"description": "Note taking app. Like Notepad, but meow!",
|
||||
"type": "project",
|
||||
"authors": [
|
||||
{
|
||||
"name": "binaryDiv",
|
||||
"email": "binarydiv@gmail.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^7.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"NoteCat\\": "src/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Tests\\Unit\\": "tests/unit/"
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.2/phpunit.xsd"
|
||||
bootstrap="vendor/autoload.php"
|
||||
executionOrder="depends,defects"
|
||||
forceCoversAnnotation="true"
|
||||
beStrictAboutCoversAnnotation="true"
|
||||
beStrictAboutOutputDuringTests="true"
|
||||
beStrictAboutTodoAnnotatedTests="true"
|
||||
verbose="true">
|
||||
|
||||
<testsuites>
|
||||
<testsuite name="unit-tests">
|
||||
<directory suffix="Test.php">tests/unit</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<filter>
|
||||
<whitelist processUncoveredFilesFromWhitelist="true">
|
||||
<directory suffix=".php">src</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
|
||||
<logging>
|
||||
<log type="coverage-html" target="coverage/" lowUpperBound="60" highLowerBound="100"/>
|
||||
<log type="coverage-text" target="php://stdout" showUncoveredFiles="false"/>
|
||||
</logging>
|
||||
</phpunit>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use NoteCat\HelloWorld;
|
||||
|
||||
$hello = new HelloWorld();
|
||||
echo '<b>' . $hello->getHello() . "</b>\n";
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace NoteCat;
|
||||
|
||||
class HelloWorld
|
||||
{
|
||||
public function getHello(): string
|
||||
{
|
||||
return 'Hello world! :3';
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use NoteCat\HelloWorld;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers NoteCat\HelloWorld
|
||||
*/
|
||||
final class HelloWorldTest extends TestCase
|
||||
{
|
||||
public function testGetHello(): void
|
||||
{
|
||||
$hello = new HelloWorld();
|
||||
$this->assertSame('Hello Drone! :3', $hello->getHello());
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue