PHP code example of kirkbater / soft-deletes

1. Go to this page and download the library: Download kirkbater/soft-deletes 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/ */

    

kirkbater / soft-deletes example snippets




use Kirkbater\Testing\SoftDeletes;

class MyTestClass extends TestClass {

    use SoftDeletes;

}


...

public function tests_that_its_soft_deleted()
{
    $user = [
        "id" => 1,
        "first" => "Test",
        "last" => "Name",
        "username" => "txltwc"
    ];

    $response = $this->call('delete', '/users/'.$user->id, []);
    $this->assertEquals(200, $response->status());
    $this->seeInDatabase("users", $user);
    $this->seeIsSoftDeletedInDatabase("users", $user);