Skip to content

Commit

Permalink
🩹 fix: renamed methods
Browse files Browse the repository at this point in the history
  • Loading branch information
tombroucke committed Dec 11, 2024
1 parent 5b0a42b commit 19a6146
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 34 deletions.
6 changes: 3 additions & 3 deletions tests/DatePickerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,23 @@ protected function setUp(): void
$this->datePicker = DatePicker::createFromFormat('d/m/Y', '29/10/2022');
}

public function testCanBeCreated(): void
public function test_can_be_created(): void
{
$this->assertInstanceOf(
DatePicker::class,
$this->datePicker
);
}

public function testDateCanBeFormatted(): void
public function test_date_can_be_formatted(): void
{
$this->assertEquals(
'2022-10-29',
$this->datePicker->format('Y-m-d')
);
}

public function testTimeStampsCanBeReturned(): void
public function test_time_stamps_can_be_returned(): void
{
$this->assertIsInt(
$this->datePicker->getTimestamp()
Expand Down
6 changes: 3 additions & 3 deletions tests/FieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ protected function setUp(): void
$this->emptyField = new Field(false, 0, []);
}

public function testValue()
public function test_value()
{
$this->assertEquals((string) $this->field, $this->value['url']);
}

public function testValueIsCorrect()
public function test_value_is_correct()
{
$this->assertTrue($this->field->isSet());
$this->assertFalse($this->emptyField->isSet());
}

public function testDefaultReturnsObject()
public function test_default_returns_object()
{
$this->assertIsObject($this->field->default(['title' => 'Title', 'url' => 'https://example.com']));
}
Expand Down
10 changes: 5 additions & 5 deletions tests/FileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,31 +62,31 @@ protected function setUp(): void
$this->emptyFile = new File([], null, []);
}

public function testUrl()
public function test_url()
{
$this->assertEquals('https://example.com/imagetitle-scaled.jpg', $this->file->url());
$this->assertNull($this->emptyFile->url());
}

public function testTitle()
public function test_title()
{
$this->assertEquals('imagetitle', $this->file->title());
$this->assertNull($this->emptyFile->title());
}

public function testMimeType()
public function test_mime_type()
{
$this->assertEquals('image/jpeg', $this->file->mimeType());
$this->assertNull($this->emptyFile->mimeType());
}

public function testWidth()
public function test_width()
{
$this->assertEquals(2560, $this->file->width());
$this->assertNull($this->emptyFile->width());
}

public function testHeight()
public function test_height()
{
$this->assertEquals(638, $this->file->height());
$this->assertNull($this->emptyFile->height());
Expand Down
2 changes: 1 addition & 1 deletion tests/GalleryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected function setUp(): void
$this->gallery = new Gallery($this->galleryArray, null, []);
}

public function testGalleryHasTwoImages()
public function test_gallery_has_two_images()
{
$this->assertEquals(1, count($this->gallery));
}
Expand Down
24 changes: 12 additions & 12 deletions tests/GoogleMapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,84 +32,84 @@ protected function setUp(): void
$this->emptyGoogleMap = new GoogleMap([], null, []);
}

public function testAddress()
public function test_address()
{
$this->assertEquals('Em. Zolastraat, Menen, Belgium', $this->googleMap->address());
$this->assertNull($this->emptyGoogleMap->address());
$this->assertEquals('Em. Zolastraat, Menen, Belgium', $this->emptyGoogleMap->default(['address' => 'Em. Zolastraat, Menen, Belgium'])->address());
}

public function testLat()
public function test_lat()
{
$this->assertEquals(50.80698, $this->googleMap->lat());
$this->assertNull($this->emptyGoogleMap->lat());
$this->assertEquals(50.80698, $this->googleMap->default(['lat' => 50.80698])->lat());
}

public function testLng()
public function test_lng()
{
$this->assertEquals(3.1082768, $this->googleMap->lng());
$this->assertNull($this->emptyGoogleMap->lng());
$this->assertEquals(3.1082768, $this->googleMap->default(['lng' => 3.1082768])->lng());
}

public function testZoom()
public function test_zoom()
{
$this->assertEquals(14, $this->googleMap->zoom());
$this->assertNull($this->emptyGoogleMap->zoom());
$this->assertEquals(14, $this->googleMap->default(['zoom' => 14])->zoom());
}

public function testName()
public function test_name()
{
$this->assertEquals('Em. Zolastraat', $this->googleMap->name());
$this->assertNull($this->emptyGoogleMap->name());
$this->assertEquals('Em. Zolastraat', $this->googleMap->default(['name' => 'Em. Zolastraat'])->name());
}

public function testStreetName()
public function test_street_name()
{
$this->assertEquals('Em. Zolastraat', $this->googleMap->StreetName());
$this->assertNull($this->emptyGoogleMap->StreetName());
$this->assertEquals('Em. Zolastraat', $this->googleMap->default(['StreetName' => 'Em. Zolastraat'])->StreetName());
}

public function testCity()
public function test_city()
{
$this->assertEquals('Menen', $this->googleMap->city());
$this->assertNull($this->emptyGoogleMap->city());
$this->assertEquals('Menen', $this->googleMap->default(['city' => 'Menen'])->city());
}

public function testState()
public function test_state()
{
$this->assertEquals('Vlaams Gewest', $this->googleMap->state());
$this->assertNull($this->emptyGoogleMap->state());
$this->assertEquals('Vlaams Gewest', $this->googleMap->default(['state' => 'Vlaams Gewest'])->state());
}

public function testStateShort()
public function test_state_short()
{
$this->assertEquals('WV', $this->googleMap->stateShort());
$this->assertNull($this->emptyGoogleMap->stateShort());
$this->assertEquals('WV', $this->googleMap->default(['stateShort' => 'WV'])->stateShort());
}

public function testPostCode()
public function test_post_code()
{
$this->assertEquals('8930', $this->googleMap->postCode());
$this->assertNull($this->emptyGoogleMap->postCode());
$this->assertEquals('8930', $this->googleMap->default(['postcode' => '8930'])->postCode());
}

public function testCountry()
public function test_country()
{
$this->assertEquals('Belgium', $this->googleMap->country());
$this->assertNull($this->emptyGoogleMap->country());
$this->assertEquals('Belgium', $this->googleMap->default(['country' => 'Belgium'])->country());
}

public function testCountryShort()
public function test_country_short()
{
$this->assertEquals('BE', $this->googleMap->countryShort());
$this->assertNull($this->emptyGoogleMap->countryShort());
Expand Down
6 changes: 3 additions & 3 deletions tests/ImageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ protected function setUp(): void
$this->emptyImage = new Image(false, null, []);
}

public function testUrlIsCorrect()
public function test_url_is_correct()
{
$this->assertEquals($this->image->url('medium'), 'https://example.com/imagetitle-300x75.jpg');
$this->assertEquals($this->imageFromUrl->url('medium'), 'https://example.com/image.jpg');
Expand All @@ -101,12 +101,12 @@ public function testUrlIsCorrect()
$this->assertEquals($this->emptyImage->default('https://example.com/image.jpg')->url('medium'), 'https://example.com/image.jpg');
}

public function testImageAltIsCorrect()
public function test_image_alt_is_correct()
{
$this->assertEquals($this->image->alt(), 'Image Title');
}

public function testToStringIsCorrect()
public function test_to_string_is_correct()
{
$this->assertEquals((string) $this->image, 'https://example.com/imagetitle-150x150.jpg');
$this->assertEquals($this->emptyImage, '');
Expand Down
12 changes: 6 additions & 6 deletions tests/LinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,37 +31,37 @@ protected function setUp(): void
$linkArray = $this->linkArray;
}

public function testUrlIsCorrect()
public function test_url_is_correct()
{
$this->assertIsString($this->link->url());
$this->assertEquals($this->link->url(), $this->linkArray['url']);
$this->assertNull($this->emptyLink->url());
}

public function testTitleIsCorrect()
public function test_title_is_correct()
{
$this->assertIsString($this->link->title());
$this->assertEquals($this->link->title(), $this->linkArray['title']);
$this->assertNull($this->emptyLink->title());
}

public function testTargetReturnTypeIsCorrect()
public function test_target_return_type_is_correct()
{
$this->assertIsString($this->link->target());
$this->assertNull($this->emptyLink->target());
}

public function testTargetIsCorrect()
public function test_target_is_correct()
{
$this->assertEquals($this->link->target(), $this->linkArray['target']);
}

public function testLinkisCorrect()
public function test_linkis_correct()
{
$this->assertEquals($this->emptyLink->title(), '');
}

public function testToStringIsCorrect()
public function test_to_string_is_correct()
{
$this->assertEquals($this->link, $this->linkArray['url']);
$this->assertEquals($this->emptyLink, '');
Expand Down
2 changes: 1 addition & 1 deletion tests/RepeaterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ protected function setUp(): void
$this->repeater = new Repeater($this->repeaterArray, null, []);
}

public function testRepeaterHasTwoRows()
public function test_repeater_has_two_rows()
{
$this->assertEquals(3, count($this->repeater));
}
Expand Down

0 comments on commit 19a6146

Please sign in to comment.