Skip to content

Commit

Permalink
Adding missing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Dec 21, 2020
1 parent 0c0b636 commit 0f36b21
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/MultiavatarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,23 @@ public function it_will_return_the_same_svg_with_a_numeric_or_string_part(): voi
/** @test */
public function it_will_return_the_same_svg_with_a_case_insensitive_theme(): void
{
$svgLowerTheme = ($this->multiavatar)('foobar', ['ver' => ['theme' => 'a']]);
$svgUpperTheme = ($this->multiavatar)('foobar', ['ver' => ['theme' => 'A']]);
$svgLowerTheme = ($this->multiavatar)('foobar', ['ver' => ['part' => 5, 'theme' => 'A']]);
$svgUpperTheme = ($this->multiavatar)('foobar', ['ver' => ['part' => '05', 'theme' => 'a']]);

self::assertSame($svgLowerTheme, $svgUpperTheme);
}

/** @test */
public function it_will_return_the_same_svg_if_the_ver_is_fully_setting_independently_of_the_avatar_id_value(): void
{
$options = ['ver' => ['theme' => 'A', 'part' => 3]];

$svgWithFixedVer1 = ($this->multiavatar)('first-avatar', $options);
$svgWithFixedVer2 = ($this->multiavatar)('second-avatar', $options);

self::assertSame($svgWithFixedVer1, $svgWithFixedVer2);
}

/** @test */
public function it_will_return_the_same_svg_with_sans_env_truthy_values(): void
{
Expand Down Expand Up @@ -98,6 +109,15 @@ public function it_will_return_different_svg_with_sans_env_values(): void
self::assertNotSame($svgSansEnvFalse, $svgSansEnvTrue);
}

/** @test */
public function it_will_return_the_same_svg_with_avatar_id_numeric_or_string(): void
{
$svgAvatarIdIsString = ($this->multiavatar)('1234567890');
$svgAvatarIdIsNumeric = ($this->multiavatar)(1234567890);

self::assertSame($svgAvatarIdIsNumeric, $svgAvatarIdIsString);
}

/**
* @test
* @dataProvider getEmptySvgProvider
Expand Down

0 comments on commit 0f36b21

Please sign in to comment.