MCPcopy Create free account
hub / github.com/Rello/analytics / testParseFilter

Method testParseFilter

tests/Service/VariableServiceTest.php:38–55  ·  view source on GitHub ↗

* @dataProvider filterProvider */

(string $variable)

Source from the content-addressed store, hash-verified

36 * @dataProvider filterProvider
37 */
38 public function testParseFilter(string $variable)
39 {
40 $ref = new \ReflectionMethod(VariableService::class, 'parseFilter');
41 $result = $ref->invoke($this->service, $variable);
42
43 $this->assertIsArray($result);
44 $this->assertArrayHasKey('option', $result);
45 $this->assertArrayHasKey('value', $result);
46
47 if (str_contains($variable, 'quarter')) {
48 $this->assertSame('BETWEEN', $result['option']);
49 $this->assertIsArray($result['value']);
50 $this->assertCount(2, $result['value']);
51 } else {
52 $this->assertSame('GT', $result['option']);
53 $this->assertIsInt($result['value']);
54 }
55 }
56
57 public function filterProvider(): array
58 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected