Hoa central
Suite.php
Go to the documentation of this file.
1 <?php
2 
37 namespace Hoa\Test\Unit;
38 
39 use atoum;
40 use Hoa\Core;
41 use Hoa\Test;
42 
51 class Suite extends atoum\test
52 {
53  public function __construct()
54  {
55  $this->setMethodPrefix('case');
56  parent::__construct();
57 
58  $protocol = Core::getInstance()->getProtocol();
59  $protocol['Test'] = new Core\Protocol\Generic('Test', null);
60  $protocol['Test']['Vfs'] = new Test\Protocol\Vfs();
61 
62  return;
63  }
64 
65  public function getTestedClassName()
66  {
67  return 'StdClass';
68  }
69 
70  public function getTestedClassNamespace()
71  {
72  return '\\';
73  }
74 
75  public function beforeTestMethod($methodName)
76  {
77  $out = parent::beforeTestMethod($methodName);
78  $testedClassName = self::getTestedClassNameFromTestClass(
79  $this->getClass(),
80  $this->getTestNamespace()
81  );
82  $testedNamespace = substr(
83  $testedClassName,
84  0,
85  strrpos($testedClassName, '\\')
86  );
87 
88  $this->getPhpMocker()->setDefaultNamespace($testedNamespace);
89 
90  return $out;
91  }
92 }
static getInstance()
Definition: Core.php:193
getTestedClassNamespace()
Definition: Suite.php:70
beforeTestMethod($methodName)
Definition: Suite.php:75