Skip to content

Commit

Permalink
Tests assertions added
Browse files Browse the repository at this point in the history
Marc committed Jun 14, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
andrewxhill Andrew W. Hill
1 parent 0a85cc2 commit 3ff7d37
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/Tests/TestCaseTest.php
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
namespace Tests;

use Mvdgeijn\BNamed\BNamed;
use Mvdgeijn\BNamed\Responses\CheckResponse;
use PHPUnit\Framework\TestCase;

include('../test.php');
@@ -24,6 +25,18 @@ public function testCheckDomain()

$result = $bNamed->check(['yahoo.com','yahoo-5391342341.com','1.com']);

dd( $result );
$this->assertTrue( count( $result->data ) == 3, 'Number of results is not 3' );

$this->assertTrue( isset( $result->data['yahoo.com'] ) == true, 'Result for yahoo.com not in result data');
$this->assertTrue( $result->data['yahoo.com']['sld'] == "yahoo", 'sld does not contain yahoo' );
$this->assertTrue( $result->data['yahoo.com']['tld'] == "com", 'tld does not contain com' );
$this->assertTrue( $result->data['yahoo.com']['code'] == CheckResponse::REGISTERED, 'status is not registered' );

$this->assertTrue( isset( $result->data['yahoo-5391342341.com'] ) == true, 'Result for yahoo-5391342341.com not in result data' );
$this->assertTrue( $result->data['yahoo-5391342341.com']['sld'] == "yahoo-5391342341", 'sld does not contain yahoo-5391342341' );
$this->assertTrue( $result->data['yahoo-5391342341.com']['tld'] == "com", 'tld does not contain com' );
$this->assertTrue( $result->data['yahoo-5391342341.com']['code'] == CheckResponse::UNREGISTERED, 'status is not unregistered' );

$this->assertTrue( isset( $result->data['1.com'] ) );
}
}

0 comments on commit 3ff7d37

Please sign in to comment.