Closed krwu closed 4 years ago
Hoping that the framework could support more ability for writing tests as Laravel does.
This is very good! I have no objections, most likely will add more test stubs or move some to an external package while writing the "Testing application" documentation. But this is a very good start. Thank you so much.
This is very good! I have no objections, most likely will add more test stubs or move some to an external package while writing the "Testing application" documentation. But this is a very good start. Thank you so much.
I think the framework should provide the testing component out of the box, including classes, traits, asserts and scaffold commands.
For example, like this:
php app.php create:test --unit UserEntityTest
<?php
declare(strict_types=1);
namespace Tests\Unit;
use Spiral\Testing\BaseTestCase;
use App\Entities\UserEntity as User;
class UserEntityTest extends BaseTestCase
{
public function TestUserHasName()
{
$name = 'Foo';
$user = new User($name);
$this->assertEqual($name, $user->getName());
}
}
Yes, I agree. However, currently the priority on completing the documentation. We have a massive backlog. :)
Yes, I agree. However, currently the priority on completing the documentation. We have a massive backlog. :)
I can understand it, hoping more and more developers will join and contribute to Spiral.
To users who use this skeleton application, they should be able to start writing tests immediately.
I add PHPUnit and the startup configuration for the spiral app.
Usage:
Tests\TestCase
, notPHPUnit\Framework\TestCase
$this->get()
,$this->post
,$this->request
,$this->runCommand
, etc.