コード例 #1
0
 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']);
 }
コード例 #2
0
 public function testFactoryCanSetPreDefinedParser()
 {
     $libYamlParser = new LibYAMLParser();
     $loader = DataSetLoaderFactory::YAML(self::testFile, NULL, $libYamlParser);
     $this->assertInstanceOf(LibYAMLParser::class, $loader->getParser());
 }
コード例 #3
0
 public function testLoaderUseTheFirstDataSetIfNoOneSpecified()
 {
     $result = DataSetLoaderFactory::YAML(self::testFile)->getResult();
     $this->assertCount(1, $result);
     $this->assertEquals('TEST', $result[0]['input']);
 }