function testGetInputs() { $inputs = AssertiveTemplate::getInputs($this->simple); $this->assertEquals(3, count($inputs)); $this->assertEquals(array('title', 'aBlock', 'max'), array_keys($inputs)); $this->assertEquals("string", $inputs['title']['type']); $this->assertTrue($inputs['title']['required']); $this->assertEquals("Block", $inputs['aBlock']['type']); $this->assertTrue($inputs['aBlock']['required']); $this->assertEquals("int", $inputs['max']['type']); $this->assertFalse($inputs['max']['required']); }
/** * Returns a multi-dimensional array that describes the inputs * of a part. Data available: * array[$inputName]['required'] = boolean * array[$inputName]['type'] = string type representation * * @param string Part name relative to AssertiveTemplate's paths. * @param string Always use 'Part' here. * @returns array Representation of required inputs. */ public static function getInputs($part, $class = 'Part') { return parent::getInputs($part . '.part.php', $class); }