Skip to content

Commit

Permalink
Rename the property for consistency with API
Browse files Browse the repository at this point in the history
  • Loading branch information
philippe-pixieset committed Jan 10, 2024
1 parent 0ac934b commit fb68d02
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
26 changes: 13 additions & 13 deletions src/Databases/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private function __construct(
public readonly array $properties,
public readonly DatabaseParent $parent,
public readonly string $url,
public readonly bool $inline,
public readonly bool $isInline,
) {
if ($cover !== null && $cover->isInternal()) {
throw DatabaseException::internalCover();
Expand Down Expand Up @@ -163,7 +163,7 @@ public function toArray(): array
"properties" => $this->propertiesToArray(),
"parent" => $this->parent->toArray(),
"url" => $this->url,
"is_inline" => $this->inline,
"is_inline" => $this->isInline,
];
}

Expand All @@ -188,7 +188,7 @@ public function changeTitle(string $title): self
$this->properties,
$this->parent,
$this->url,
$this->inline,
$this->isInline,
);
}

Expand All @@ -205,7 +205,7 @@ public function changeAdvancedTitle(RichText ...$title): self
$this->properties,
$this->parent,
$this->url,
$this->inline,
$this->isInline,
);
}

Expand All @@ -230,7 +230,7 @@ public function changeIcon(Emoji|File|Icon $icon): self
$this->properties,
$this->parent,
$this->url,
$this->inline,
$this->isInline,
);
}

Expand All @@ -247,7 +247,7 @@ public function removeIcon(): self
$this->properties,
$this->parent,
$this->url,
$this->inline,
$this->isInline,
);
}

Expand All @@ -264,7 +264,7 @@ public function changeCover(File $cover): self
$this->properties,
$this->parent,
$this->url,
$this->inline,
$this->isInline,
);
}

Expand All @@ -281,7 +281,7 @@ public function removeCover(): self
$this->properties,
$this->parent,
$this->url,
$this->inline,
$this->isInline,
);
}

Expand All @@ -303,7 +303,7 @@ public function addProperty(PropertyInterface $property): self
$this->properties()->add($property)->getAll(),
$this->parent,
$this->url,
$this->inline,
$this->isInline,
);
}

Expand All @@ -320,7 +320,7 @@ public function removePropertyByName(string $propertyName): self
$this->properties()->remove($propertyName)->getAll(),
$this->parent,
$this->url,
$this->inline,
$this->isInline,
);
}

Expand All @@ -337,7 +337,7 @@ public function changeProperty(PropertyInterface $property): self
$this->properties()->change($property)->getAll(),
$this->parent,
$this->url,
$this->inline,
$this->isInline,
);
}

Expand All @@ -355,7 +355,7 @@ public function changeProperties(array $properties): self
PropertyCollection::create(...$properties)->getAll(),
$this->parent,
$this->url,
$this->inline,
$this->isInline,
);
}

Expand All @@ -372,7 +372,7 @@ public function changeParent(DatabaseParent $parent): self
$this->properties,
$parent,
$this->url,
$this->inline,
$this->isInline,
);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/DatabasesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function test_create_inline_database(): void
$databaseFound = $client->databases()->find($database->id);

$this->assertEquals("Inline database", $database->title[0]->plainText);
$this->assertTrue($databaseFound->inline);
$this->assertTrue($databaseFound->isInline);

$client->databases()->delete($database);
}
Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/Databases/DatabaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public function test_array_conversion(): void
"2020-12-08T12:00:00.000000Z",
$database->lastEditedTime->format(Date::FORMAT),
);
$this->assertTrue($database->inline);
$this->assertTrue($database->isInline);
}

public function test_from_array_change_emoji_icon(): void
Expand Down Expand Up @@ -337,12 +337,12 @@ public function test_inline(): void
{
$parent = DatabaseParent::page("1ce62b6f-b7f3-4201-afd0-08acb02e61c6");
$database = Database::create($parent);
$this->assertFalse($database->inline);
$this->assertFalse($database->isInline);

$database = $database->enableInline();
$this->assertTrue($database->inline);
$this->assertTrue($database->isInline);

$database = $database->disableInline();
$this->assertFalse($database->inline);
$this->assertFalse($database->isInline);
}
}

0 comments on commit fb68d02

Please sign in to comment.