forked from radicalloop/eodhistoricaldata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
StockTest.php
52 lines (44 loc) · 1.23 KB
/
StockTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
use PHPUnit\Framework\TestCase;
use RadicalLoop\Eod\Config;
use RadicalLoop\Eod\Eod;
class StockTest extends TestCase
{
protected $stock;
protected function setUp(): void
{
parent::setUp();
$apiToken = getenv('API_TOKEN');
$this->stock = (new Eod(new Config($apiToken)))->stock();
}
public function test_realtime_api()
{
$content = $this->stock->realTime('AAPL.US')->json();
$this->assertNotEmpty($content);
}
public function test_fundamental_data_api()
{
$content = $this->stock->fundamental('AAPL.US')->json();
$this->assertNotEmpty($content);
}
public function test_dividend_api()
{
$content = $this->stock->dividend('AAPL.US')->json();
$this->assertNotEmpty($content);
}
public function test_splits_api()
{
$content = $this->stock->splits('AAPL.US')->json();
$this->assertNotEmpty($content);
}
public function test_eod_api()
{
$content = $this->stock->eod('AAPL.US')->json();
$this->assertNotEmpty($content);
}
public function test_yahoo_api()
{
$content = $this->stock->yahoo('AAPL.US')->json();
$this->assertNotEmpty($content);
}
}