public function testSave() { $faker = Faker\Factory::create(); $role = \Distilleries\Expendable\Models\Role::create(['libelle' => $faker->name, 'initials' => $faker->name, 'overide_permission' => true]); $service = \Distilleries\Expendable\Models\Service::create(['action' => $faker->name]); $data = [$role->id => [$service->id]]; $this->call('POST', action($this->controller . '@postEdit'), ['permission' => $data]); $total = \Distilleries\Expendable\Models\Permission::where('role_id', $role->id)->where('service_id', $service->id)->count(); $this->assertEquals(1, $total); }