Bake\Shell\Task\TestTask::mapType PHP Méthode

mapType() public méthode

Map the types that TestTask uses to concrete types that App::className can use.
public mapType ( string $type ) : string
$type string The type of thing having a test generated.
Résultat string
    public function mapType($type)
    {
        $type = ucfirst($type);
        if (empty($this->classTypes[$type])) {
            throw new Exception('Invalid object type.');
        }
        return $this->classTypes[$type];
    }

Usage Example

Exemple #1
0
 /**
  * Test that mapType returns the correct package names.
  *
  * @dataProvider mapTypeProvider
  * @return void
  */
 public function testMapType($original, $expected)
 {
     $this->assertEquals($expected, $this->Task->mapType($original));
 }