| Total Complexity | 5 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class HelpersTest extends UnitTestCase |
||
| 9 | { |
||
| 10 | public function testStrReplaceToken() |
||
| 11 | { |
||
| 12 | $url = 'http://www.pullrequest.com/:id'; |
||
| 13 | $tokens = ['id' => 'hi']; |
||
| 14 | $generatedUrl = str_replace_tokens($url, $tokens); |
||
| 15 | |||
| 16 | $this->assertSame('http://www.pullrequest.com/hi', $generatedUrl); |
||
| 17 | } |
||
| 18 | |||
| 19 | public function testResourceOrScreeningValidClassName() |
||
| 20 | { |
||
| 21 | $screening = $this->getScreening(); |
||
| 22 | $resource = $this->getResource(); |
||
| 23 | |||
| 24 | $screeningName = checkrEntityClassName('ssn_trace'); |
||
| 25 | $resourceName = checkrEntityClassName('adverse_actions'); |
||
| 26 | |||
| 27 | $this->assertSame('\\' . get_class($screening), $screeningName); |
||
| 28 | $this->assertSame('\\' . get_class($resource), $resourceName); |
||
| 29 | } |
||
| 30 | |||
| 31 | public function testResourceOrScreeningInvalidClassName() |
||
| 32 | { |
||
| 33 | // Check for the existence of a random unique id class |
||
| 34 | $object = checkrEntityClassName(uniqid('', false)); |
||
| 35 | $this->assertFalse($object); |
||
| 36 | } |
||
| 37 | |||
| 38 | private function getScreening(array $values = []) |
||
| 39 | { |
||
| 40 | return new SsnTrace($values, $this->getClient()); |
||
| 41 | } |
||
| 42 | |||
| 43 | private function getResource(array $values = []) |
||
| 44 | { |
||
| 45 | return new AdverseAction($values, $this->getClient()); |
||
| 46 | |||
| 50 |