Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ca75cd4
commit 6edac26
Showing
4 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ build | |
composer.lock | ||
docs | ||
vendor | ||
tests/ApiTest.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace Tests; | ||
|
||
use GuzzleHttp\Client; | ||
use OhDear\PhpSdk\OhDear; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class ApiTest extends TestCase | ||
{ | ||
/** @test */ | ||
public function it_tests() | ||
{ | ||
//production | ||
//$apiKey = 'H3VPxvHDyAQ8zMr3WxIrUJHoZsImk0TQMffp9rrpe7xBwbc9332mGqUXTqkX'; | ||
|
||
//test | ||
$apiKey = 'c2nh018eM1pTjqfbuF90ILuscZwlBISVPj7tJB8laoWS1Sg2jgf8FBlIIkgB'; | ||
|
||
$testClient = new Client([ | ||
'base_uri' => 'http://ohdearapp.com.dev/api/', | ||
'http_errors' => false, | ||
'headers' => [ | ||
'Authorization' => 'Bearer '.$apiKey, | ||
'Accept' => 'application/json', | ||
'Content-Type' => 'application/json' | ||
] | ||
]); | ||
|
||
$ohDear = new OhDear($apiKey, $testClient); | ||
|
||
var_dump($site = $ohDear->site(2)); | ||
$site->delete(); | ||
die(); | ||
$this->info('creating site https://newsite.com'); | ||
$ohDear->createSite(['url' => 'https://newsite.com', 'team_id' => 2]); | ||
$this->info('done'); | ||
} | ||
} |