Skip to content

Commit 9556739

Browse files
committed
Updated test for new static values that are not constants.
1 parent 0a8caf9 commit 9556739

File tree

1 file changed

+57
-56
lines changed

1 file changed

+57
-56
lines changed

Tests/TraderTest.php

Lines changed: 57 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,67 @@
11
<?php
22

33
require_once __DIR__ . '/../source/Trader.php';
4+
require_once __DIR__ . '/../source/TraderTrait.php';
45

56
class TraderTest extends PHPUnit_Framework_TestCase
67
{
78
public function testConstants()
89
{
9-
$this->assertEquals(TRADER_MA_TYPE_SMA, \LupeCode\phpTraderInterface\Trader::TRADER_MA_TYPE_SMA);
10-
$this->assertEquals(TRADER_MA_TYPE_EMA, \LupeCode\phpTraderInterface\Trader::TRADER_MA_TYPE_EMA);
11-
$this->assertEquals(TRADER_MA_TYPE_WMA, \LupeCode\phpTraderInterface\Trader::TRADER_MA_TYPE_WMA);
12-
$this->assertEquals(TRADER_MA_TYPE_DEMA, \LupeCode\phpTraderInterface\Trader::TRADER_MA_TYPE_DEMA);
13-
$this->assertEquals(TRADER_MA_TYPE_TEMA, \LupeCode\phpTraderInterface\Trader::TRADER_MA_TYPE_TEMA);
14-
$this->assertEquals(TRADER_MA_TYPE_TRIMA, \LupeCode\phpTraderInterface\Trader::TRADER_MA_TYPE_TRIMA);
15-
$this->assertEquals(TRADER_MA_TYPE_KAMA, \LupeCode\phpTraderInterface\Trader::TRADER_MA_TYPE_KAMA);
16-
$this->assertEquals(TRADER_MA_TYPE_MAMA, \LupeCode\phpTraderInterface\Trader::TRADER_MA_TYPE_MAMA);
17-
$this->assertEquals(TRADER_MA_TYPE_T3, \LupeCode\phpTraderInterface\Trader::TRADER_MA_TYPE_T3);
18-
$this->assertEquals(TRADER_REAL_MIN, \LupeCode\phpTraderInterface\Trader::TRADER_REAL_MIN);
19-
$this->assertEquals(TRADER_REAL_MAX, \LupeCode\phpTraderInterface\Trader::TRADER_REAL_MAX);
20-
$this->assertEquals(TRADER_FUNC_UNST_ADX, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_ADX);
21-
$this->assertEquals(TRADER_FUNC_UNST_ADXR, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_ADXR);
22-
$this->assertEquals(TRADER_FUNC_UNST_ATR, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_ATR);
23-
$this->assertEquals(TRADER_FUNC_UNST_CMO, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_CMO);
24-
$this->assertEquals(TRADER_FUNC_UNST_DX, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_DX);
25-
$this->assertEquals(TRADER_FUNC_UNST_EMA, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_EMA);
26-
$this->assertEquals(TRADER_FUNC_UNST_HT_DCPERIOD, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_HT_DCPERIOD);
27-
$this->assertEquals(TRADER_FUNC_UNST_HT_DCPHASE, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_HT_DCPHASE);
28-
$this->assertEquals(TRADER_FUNC_UNST_HT_PHASOR, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_HT_PHASOR);
29-
$this->assertEquals(TRADER_FUNC_UNST_HT_TRENDLINE, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_HT_TRENDLINE);
30-
$this->assertEquals(TRADER_FUNC_UNST_HT_TRENDMODE, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_HT_TRENDMODE);
31-
$this->assertEquals(TRADER_FUNC_UNST_KAMA, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_KAMA);
32-
$this->assertEquals(TRADER_FUNC_UNST_MAMA, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_MAMA);
33-
$this->assertEquals(TRADER_FUNC_UNST_MFI, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_MFI);
34-
$this->assertEquals(TRADER_FUNC_UNST_MINUS_DI, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_MINUS_DI);
35-
$this->assertEquals(TRADER_FUNC_UNST_MINUS_DM, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_MINUS_DM);
36-
$this->assertEquals(TRADER_FUNC_UNST_NATR, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_NATR);
37-
$this->assertEquals(TRADER_FUNC_UNST_PLUS_DI, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_PLUS_DI);
38-
$this->assertEquals(TRADER_FUNC_UNST_PLUS_DM, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_PLUS_DM);
39-
$this->assertEquals(TRADER_FUNC_UNST_RSI, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_RSI);
40-
$this->assertEquals(TRADER_FUNC_UNST_STOCHRSI, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_STOCHRSI);
41-
$this->assertEquals(TRADER_FUNC_UNST_T3, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_T3);
42-
$this->assertEquals(TRADER_FUNC_UNST_ALL, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_ALL);
43-
$this->assertEquals(TRADER_FUNC_UNST_NONE, \LupeCode\phpTraderInterface\Trader::TRADER_FUNC_UNST_NONE);
44-
$this->assertEquals(TRADER_COMPATIBILITY_DEFAULT, \LupeCode\phpTraderInterface\Trader::TRADER_COMPATIBILITY_DEFAULT);
45-
$this->assertEquals(TRADER_COMPATIBILITY_METASTOCK, \LupeCode\phpTraderInterface\Trader::TRADER_COMPATIBILITY_METASTOCK);
46-
$this->assertEquals(TRADER_ERR_SUCCESS, \LupeCode\phpTraderInterface\Trader::TRADER_ERR_SUCCESS);
47-
$this->assertEquals(TRADER_ERR_LIB_NOT_INITIALIZE, \LupeCode\phpTraderInterface\Trader::TRADER_ERR_LIB_NOT_INITIALIZE);
48-
$this->assertEquals(TRADER_ERR_BAD_PARAM, \LupeCode\phpTraderInterface\Trader::TRADER_ERR_BAD_PARAM);
49-
$this->assertEquals(TRADER_ERR_ALLOC_ERR, \LupeCode\phpTraderInterface\Trader::TRADER_ERR_ALLOC_ERR);
50-
$this->assertEquals(TRADER_ERR_GROUP_NOT_FOUND, \LupeCode\phpTraderInterface\Trader::TRADER_ERR_GROUP_NOT_FOUND);
51-
$this->assertEquals(TRADER_ERR_FUNC_NOT_FOUND, \LupeCode\phpTraderInterface\Trader::TRADER_ERR_FUNC_NOT_FOUND);
52-
$this->assertEquals(TRADER_ERR_INVALID_HANDLE, \LupeCode\phpTraderInterface\Trader::TRADER_ERR_INVALID_HANDLE);
53-
$this->assertEquals(TRADER_ERR_INVALID_PARAM_HOLDER, \LupeCode\phpTraderInterface\Trader::TRADER_ERR_INVALID_PARAM_HOLDER);
54-
$this->assertEquals(TRADER_ERR_INVALID_PARAM_HOLDER_TYPE, \LupeCode\phpTraderInterface\Trader::TRADER_ERR_INVALID_PARAM_HOLDER_TYPE);
55-
$this->assertEquals(TRADER_ERR_INVALID_PARAM_FUNCTION, \LupeCode\phpTraderInterface\Trader::TRADER_ERR_INVALID_PARAM_FUNCTION);
56-
$this->assertEquals(TRADER_ERR_INPUT_NOT_ALL_INITIALIZE, \LupeCode\phpTraderInterface\Trader::TRADER_ERR_INPUT_NOT_ALL_INITIALIZE);
57-
$this->assertEquals(TRADER_ERR_OUTPUT_NOT_ALL_INITIALIZE, \LupeCode\phpTraderInterface\Trader::TRADER_ERR_OUTPUT_NOT_ALL_INITIALIZE);
58-
$this->assertEquals(TRADER_ERR_OUT_OF_RANGE_START_INDEX, \LupeCode\phpTraderInterface\Trader::TRADER_ERR_OUT_OF_RANGE_START_INDEX);
59-
$this->assertEquals(TRADER_ERR_OUT_OF_RANGE_END_INDEX, \LupeCode\phpTraderInterface\Trader::TRADER_ERR_OUT_OF_RANGE_END_INDEX);
60-
$this->assertEquals(TRADER_ERR_INVALID_LIST_TYPE, \LupeCode\phpTraderInterface\Trader::TRADER_ERR_INVALID_LIST_TYPE);
61-
$this->assertEquals(TRADER_ERR_BAD_OBJECT, \LupeCode\phpTraderInterface\Trader::TRADER_ERR_BAD_OBJECT);
62-
$this->assertEquals(TRADER_ERR_NOT_SUPPORTED, \LupeCode\phpTraderInterface\Trader::TRADER_ERR_NOT_SUPPORTED);
63-
$this->assertEquals(TRADER_ERR_INTERNAL_ERROR, \LupeCode\phpTraderInterface\Trader::TRADER_ERR_INTERNAL_ERROR);
64-
$this->assertEquals(TRADER_ERR_UNKNOWN_ERROR, \LupeCode\phpTraderInterface\Trader::TRADER_ERR_UNKNOWN_ERROR);
10+
$this->assertEquals(TRADER_MA_TYPE_SMA, \LupeCode\phpTraderInterface\Trader::$TRADER_MA_TYPE_SMA);
11+
$this->assertEquals(TRADER_MA_TYPE_EMA, \LupeCode\phpTraderInterface\Trader::$TRADER_MA_TYPE_EMA);
12+
$this->assertEquals(TRADER_MA_TYPE_WMA, \LupeCode\phpTraderInterface\Trader::$TRADER_MA_TYPE_WMA);
13+
$this->assertEquals(TRADER_MA_TYPE_DEMA, \LupeCode\phpTraderInterface\Trader::$TRADER_MA_TYPE_DEMA);
14+
$this->assertEquals(TRADER_MA_TYPE_TEMA, \LupeCode\phpTraderInterface\Trader::$TRADER_MA_TYPE_TEMA);
15+
$this->assertEquals(TRADER_MA_TYPE_TRIMA, \LupeCode\phpTraderInterface\Trader::$TRADER_MA_TYPE_TRIMA);
16+
$this->assertEquals(TRADER_MA_TYPE_KAMA, \LupeCode\phpTraderInterface\Trader::$TRADER_MA_TYPE_KAMA);
17+
$this->assertEquals(TRADER_MA_TYPE_MAMA, \LupeCode\phpTraderInterface\Trader::$TRADER_MA_TYPE_MAMA);
18+
$this->assertEquals(TRADER_MA_TYPE_T3, \LupeCode\phpTraderInterface\Trader::$TRADER_MA_TYPE_T3);
19+
$this->assertEquals(TRADER_REAL_MIN, \LupeCode\phpTraderInterface\Trader::$TRADER_REAL_MIN);
20+
$this->assertEquals(TRADER_REAL_MAX, \LupeCode\phpTraderInterface\Trader::$TRADER_REAL_MAX);
21+
$this->assertEquals(TRADER_FUNC_UNST_ADX, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_ADX);
22+
$this->assertEquals(TRADER_FUNC_UNST_ADXR, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_ADXR);
23+
$this->assertEquals(TRADER_FUNC_UNST_ATR, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_ATR);
24+
$this->assertEquals(TRADER_FUNC_UNST_CMO, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_CMO);
25+
$this->assertEquals(TRADER_FUNC_UNST_DX, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_DX);
26+
$this->assertEquals(TRADER_FUNC_UNST_EMA, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_EMA);
27+
$this->assertEquals(TRADER_FUNC_UNST_HT_DCPERIOD, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_HT_DCPERIOD);
28+
$this->assertEquals(TRADER_FUNC_UNST_HT_DCPHASE, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_HT_DCPHASE);
29+
$this->assertEquals(TRADER_FUNC_UNST_HT_PHASOR, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_HT_PHASOR);
30+
$this->assertEquals(TRADER_FUNC_UNST_HT_TRENDLINE, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_HT_TRENDLINE);
31+
$this->assertEquals(TRADER_FUNC_UNST_HT_TRENDMODE, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_HT_TRENDMODE);
32+
$this->assertEquals(TRADER_FUNC_UNST_KAMA, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_KAMA);
33+
$this->assertEquals(TRADER_FUNC_UNST_MAMA, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_MAMA);
34+
$this->assertEquals(TRADER_FUNC_UNST_MFI, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_MFI);
35+
$this->assertEquals(TRADER_FUNC_UNST_MINUS_DI, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_MINUS_DI);
36+
$this->assertEquals(TRADER_FUNC_UNST_MINUS_DM, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_MINUS_DM);
37+
$this->assertEquals(TRADER_FUNC_UNST_NATR, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_NATR);
38+
$this->assertEquals(TRADER_FUNC_UNST_PLUS_DI, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_PLUS_DI);
39+
$this->assertEquals(TRADER_FUNC_UNST_PLUS_DM, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_PLUS_DM);
40+
$this->assertEquals(TRADER_FUNC_UNST_RSI, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_RSI);
41+
$this->assertEquals(TRADER_FUNC_UNST_STOCHRSI, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_STOCHRSI);
42+
$this->assertEquals(TRADER_FUNC_UNST_T3, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_T3);
43+
$this->assertEquals(TRADER_FUNC_UNST_ALL, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_ALL);
44+
$this->assertEquals(TRADER_FUNC_UNST_NONE, \LupeCode\phpTraderInterface\Trader::$TRADER_FUNC_UNST_NONE);
45+
$this->assertEquals(TRADER_COMPATIBILITY_DEFAULT, \LupeCode\phpTraderInterface\Trader::$TRADER_COMPATIBILITY_DEFAULT);
46+
$this->assertEquals(TRADER_COMPATIBILITY_METASTOCK, \LupeCode\phpTraderInterface\Trader::$TRADER_COMPATIBILITY_METASTOCK);
47+
$this->assertEquals(TRADER_ERR_SUCCESS, \LupeCode\phpTraderInterface\Trader::$TRADER_ERR_SUCCESS);
48+
$this->assertEquals(TRADER_ERR_LIB_NOT_INITIALIZE, \LupeCode\phpTraderInterface\Trader::$TRADER_ERR_LIB_NOT_INITIALIZE);
49+
$this->assertEquals(TRADER_ERR_BAD_PARAM, \LupeCode\phpTraderInterface\Trader::$TRADER_ERR_BAD_PARAM);
50+
$this->assertEquals(TRADER_ERR_ALLOC_ERR, \LupeCode\phpTraderInterface\Trader::$TRADER_ERR_ALLOC_ERR);
51+
$this->assertEquals(TRADER_ERR_GROUP_NOT_FOUND, \LupeCode\phpTraderInterface\Trader::$TRADER_ERR_GROUP_NOT_FOUND);
52+
$this->assertEquals(TRADER_ERR_FUNC_NOT_FOUND, \LupeCode\phpTraderInterface\Trader::$TRADER_ERR_FUNC_NOT_FOUND);
53+
$this->assertEquals(TRADER_ERR_INVALID_HANDLE, \LupeCode\phpTraderInterface\Trader::$TRADER_ERR_INVALID_HANDLE);
54+
$this->assertEquals(TRADER_ERR_INVALID_PARAM_HOLDER, \LupeCode\phpTraderInterface\Trader::$TRADER_ERR_INVALID_PARAM_HOLDER);
55+
$this->assertEquals(TRADER_ERR_INVALID_PARAM_HOLDER_TYPE, \LupeCode\phpTraderInterface\Trader::$TRADER_ERR_INVALID_PARAM_HOLDER_TYPE);
56+
$this->assertEquals(TRADER_ERR_INVALID_PARAM_FUNCTION, \LupeCode\phpTraderInterface\Trader::$TRADER_ERR_INVALID_PARAM_FUNCTION);
57+
$this->assertEquals(TRADER_ERR_INPUT_NOT_ALL_INITIALIZE, \LupeCode\phpTraderInterface\Trader::$TRADER_ERR_INPUT_NOT_ALL_INITIALIZE);
58+
$this->assertEquals(TRADER_ERR_OUTPUT_NOT_ALL_INITIALIZE, \LupeCode\phpTraderInterface\Trader::$TRADER_ERR_OUTPUT_NOT_ALL_INITIALIZE);
59+
$this->assertEquals(TRADER_ERR_OUT_OF_RANGE_START_INDEX, \LupeCode\phpTraderInterface\Trader::$TRADER_ERR_OUT_OF_RANGE_START_INDEX);
60+
$this->assertEquals(TRADER_ERR_OUT_OF_RANGE_END_INDEX, \LupeCode\phpTraderInterface\Trader::$TRADER_ERR_OUT_OF_RANGE_END_INDEX);
61+
$this->assertEquals(TRADER_ERR_INVALID_LIST_TYPE, \LupeCode\phpTraderInterface\Trader::$TRADER_ERR_INVALID_LIST_TYPE);
62+
$this->assertEquals(TRADER_ERR_BAD_OBJECT, \LupeCode\phpTraderInterface\Trader::$TRADER_ERR_BAD_OBJECT);
63+
$this->assertEquals(TRADER_ERR_NOT_SUPPORTED, \LupeCode\phpTraderInterface\Trader::$TRADER_ERR_NOT_SUPPORTED);
64+
$this->assertEquals(TRADER_ERR_INTERNAL_ERROR, \LupeCode\phpTraderInterface\Trader::$TRADER_ERR_INTERNAL_ERROR);
65+
$this->assertEquals(TRADER_ERR_UNKNOWN_ERROR, \LupeCode\phpTraderInterface\Trader::$TRADER_ERR_UNKNOWN_ERROR);
6566
}
6667
}

0 commit comments

Comments
 (0)