PHP code example of switon / testing

1. Go to this page and download the library: Download switon/testing library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

switon / testing example snippets


use Switon\Testing\TestCase;

class UserServiceTest extends TestCase
{
    public function testRegisterCreatesUser(): void
    {
        // Arrange
        $service = $this->make(UserService::class);

        // Act
        $user = $service->register('[email protected]');

        // Assert
        $this->assertSame('[email protected]', $user->email);
    }
}