tests/EloquentUuidTest.php
/**
     * Tests the creation of model with uuid as primary key.
     *
     * @return void
     */
Tests the creation of model with uuid as primary key.
@return void
Tests the creation of model with uuid as primary key . @return void
public function testCreationStringUuid()
    {
        $creation = EloquentUserModel::create([
            'username' => 'username',
            'password' => 'secret',
        ]);
        static::assertEquals(36, strlen($creation->id));
        $model = EloquentUserModel::first();
        static::assertEquals(36, strlen($model->id));
        static::assertRegExp('/^[0-9a-f-]{36}$/', $model->id);
        static::assertRegExp('/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/', $model->id);
        static::assertEquals($creation->id, $model->id);
    }
public function testCreationStringUuid ( ) { $ creation = EloquentUserModel :: create ( [ 'username' => 'username' , 'password' => 'secret' , ] ) ; static :: assertEquals ( 36 , strlen ( $ creation -> id ) ) ; $ model = EloquentUserModel :: first ( ) ; static :: assertEquals ( 36 , strlen ( $ model -> id ) ) ; static :: assertRegExp ( '/^[0-9a-f-]{36}$/' , $ model -> id ) ; static :: assertRegExp ( '/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/' , $ model -> id ) ; static :: assertEquals ( $ creation -> id , $ model -> id ) ; }
Tests the creation of model with uuid as primary key.
Tests the creation of model with uuid as primary key .