Skip to content

Commit b87d5f0

Browse files
committed
Added example src & tests dummy files
1 parent 75b604f commit b87d5f0

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

template/src/Example.php.sk_dummy

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php declare(strict_types=1);
2+
3+
/*
4+
* This file is part of {package.name} package.
5+
*
6+
* This source file is subject to the MIT license that is bundled
7+
* with this source code in the file LICENSE.
8+
*/
9+
10+
namespace {namespace.src};
11+
12+
13+
class Example
14+
{
15+
public function welcome(string $name = 'World'): string
16+
{
17+
return 'Hello ' . $name . '!';
18+
}
19+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php declare(strict_types=1);
2+
3+
/*
4+
* This file is part of {package.name} package.
5+
*
6+
* This source file is subject to the MIT license that is bundled
7+
* with this source code in the file LICENSE.
8+
*/
9+
10+
namespace {namespace.src}\Tests;
11+
12+
use PHPUnit\Framework\TestCase;
13+
use {namespace.src}\Example;
14+
15+
16+
class ExampleTest extends TestCase
17+
{
18+
public function testWelcomeMethodWithoutParameter_ReturnsDefaultWelcomeString()
19+
{
20+
$example = new Example();
21+
$this->assertSame('Hello World!', $example->welcome());
22+
}
23+
24+
public function testWelcomeMethodWithUserName_ReturnsWelcomeStringWithUserName()
25+
{
26+
$example = new Example();
27+
$this->assertSame('Hello user!', $example->welcome('user'));
28+
}
29+
}

0 commit comments

Comments
 (0)