Skip to content

Commit

Permalink
Update LaravelConfigTest.php
Browse files Browse the repository at this point in the history
  • Loading branch information
YunusEmreNalbant committed Mar 4, 2024
1 parent 8015d31 commit fbacece
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"require": {
"php": "^7.4|^8.0|^8.1|^8.2",
"ext-json": "*",
"doctrine/dbal": "^3.8",
"illuminate/support": "^8.49|^9.0|^10.0",
"laravel/legacy-factories": "^1.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function up(): void
Schema::create($tableName, function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name')->unique();
$table->enum('type', ['boolean', 'text'])->default('boolean');
$table->string('type')->default('boolean');
$table->string('val')->nullable();
$table->text('description')->nullable();
$table->timestamps();
Expand Down
8 changes: 4 additions & 4 deletions tests/LaravelConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function it_create_a_new_config_parameter(): void
{
$factory = new ConfigFactory();
$configItem = $factory->setName(Str::random(5))
->setType('boolean')
->setType(ConfigDataType::BOOLEAN)
->setValue('1')
->setDescription(Str::random(50))
->get();
Expand All @@ -46,7 +46,7 @@ public function it_create_a_new_config_parameter_with_tag(): void
{
$factory = new ConfigFactory();
$configItem = $factory->setName(Str::random(5))
->setType('boolean')
->setType(ConfigDataType::BOOLEAN)
->setValue('1')
->setTags(['system'])
->setDescription(Str::random(50))
Expand All @@ -72,7 +72,7 @@ public function it_does_not_create_a_config_parameter_with_the_same_name(): void

$factory = new ConfigFactory();
$configItem = $factory->setName($config->name)
->setType('boolean')
->setType(ConfigDataType::BOOLEAN)
->setValue('1')
->setDescription(Str::random(50))
->get();
Expand All @@ -89,7 +89,7 @@ public function it_updates_existing_config_parameter(): void
$this->assertDatabaseHas(config('laravel-config.table'), ['name' => $config->name, 'val' => $config->val]);

$factory = new ConfigFactory($config);
$configItem = $factory->setType('boolean')
$configItem = $factory->setType(ConfigDataType::BOOLEAN)
->setValue('0')
->setDescription('updated-description')
->get();
Expand Down

0 comments on commit fbacece

Please sign in to comment.