InfyOmLabs / adminlte-generator

Boilerplate of Laravel with InfyOm Laravel Generator for AdminLTE Templates
https://infyom.com/open-source/laravelgenerator/docs/8.0/boilerplates
387 stars 272 forks source link

Should created_at and updated_at participate when assertModelData? #18

Closed skys215 closed 5 years ago

skys215 commented 6 years ago

Hi,

My question is: should created_at and updated_at be checked when asserting model data on tests/ApiTestTrait.php#L25?

Can be simply skip comparing by checking the key like this:

        foreach ($actualData as $key => $value) {
            // starts here
            if( $key == 'created_at' || $key == 'updated_at'){
                continue;
            }
            //ends here
            $this->assertEquals($actualData[$key], $expectedData[$key]);
        }

Or maybe should removed when passing the $actualData? I'm not sure.