File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments