PHPUnit (Laravel) and Datatables Editor testing.

PHPUnit (Laravel) and Datatables Editor testing.

MickBMickB Posts: 103Questions: 25Answers: 2

Hi,

I have just moved to TDD and I am wondering if anyone does any unit testing for the Editor?

I was thinking something like this:

public function test_add_process_type()
    {

        $user = User::where('username', '=', 'test')->first();
        $this->be($user);
        
        $this->json('POST', '/process_typesAjax',
            [
                'table' => 'process_types',
                'action' => 'create',
                'data[0][process_types][description]' => 'test',
                'data[0][process_types][input_type_id]' => '1'
            ])
            ->seeJson();
    }


Mick

Answers

  • allanallan Posts: 63,471Questions: 1Answers: 10,467 Site admin

    I've got a bunch of unit tests for Editor locally, but they are client-side based rather than server-side (the benefit being that I can change the backend, e.g. PHP / .NET, and still run the same tests with the server-side interaction).

    I haven't actually used PHPUnit with Laravel before I'm afraid.

    Allan

This discussion has been closed.