Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PHP GBIF
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Res Telæ
PHP GBIF
Commits
754faf00
Commit
754faf00
authored
May 8, 2022
by
Francesco Abeni
Browse files
Options
Downloads
Patches
Plain Diff
Add unit tests for Occurrences class
parent
20e6adbc
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!4
Add unit tests for Occurrences class
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/Unit/OccurrencesTest.php
+41
-0
41 additions, 0 deletions
tests/Unit/OccurrencesTest.php
with
41 additions
and
0 deletions
tests/Unit/OccurrencesTest.php
0 → 100644
+
41
−
0
View file @
754faf00
<?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'
]);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment