Skip to content
Snippets Groups Projects
Commit 754faf00 authored by Francesco Abeni's avatar Francesco Abeni
Browse files

Add unit tests for Occurrences class

parent 20e6adbc
Branches
Tags
1 merge request!4Add unit tests for Occurrences class
<?php declare(strict_types=1);
namespace ResTelae\Gbif\Tests\Unit;
use PHPUnit\Framework\TestCase;
use ResTelae\Gbif\Occurrences;
use ResTelae\Gbif\Species;
final class OccurrencesTest extends TestCase
{
/** @var Occurrences */
private $occurrences;
protected function setUp(): void
{
parent::setUp();
$this->occurrences = new Occurrences();
}
public function testShouldGetValidResponseFromGet()
{
$response = $this->occurrences->get(1258202889);
$this->assertEquals("Alfaroa Standl.", $response['scientificName']);
}
public function testShouldGetValidResponseFromGetVerbatim()
{
$response = $this->occurrences->getVerbatim(1258202889);
$this->assertEquals("Alfaroa Standl.", $response['http://rs.tdwg.org/dwc/terms/scientificName']);
}
public function testShouldGetValidResponseFromGetFragment()
{
$response = $this->occurrences->getFragment(1258202889);
$this->assertEquals("Alfaroa Standl.", $response['scientificName']);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment