public function testStandardParserCanConvertTypes() { $result = DataSetLoaderFactory::XML(self::testFile, 'typedTestGroup')->getResult()['Index #0']; //String $this->assertTrue(is_string($result['input'])); //Integer $this->assertTrue(is_int($result['integerValue'])); //Bool $this->assertTrue(is_bool($result['boolValueInteger'])); $this->assertTrue($result['boolValueInteger']); $this->assertTrue(is_bool($result['boolValueTextual'])); $this->assertFalse($result['boolValueTextual']); //Float $this->assertTrue(is_float($result['floatValue'])); //Array $this->assertEquals([1, 2, 'three'], $result['arrayValue']); }
public function testFactoryCanSetPreDefinedParser() { $libYamlParser = new LibYAMLParser(); $loader = DataSetLoaderFactory::YAML(self::testFile, NULL, $libYamlParser); $this->assertInstanceOf(LibYAMLParser::class, $loader->getParser()); }
public function testLoaderUseTheFirstDataSetIfNoOneSpecified() { $result = DataSetLoaderFactory::YAML(self::testFile)->getResult(); $this->assertCount(1, $result); $this->assertEquals('TEST', $result[0]['input']); }