getMockBuilder(Extension::class) ->disableOriginalConstructor() ->getMock(); $extFoo->method('getId') ->willReturn('foo'); $generatorFoo = new TaoClassNameGenerator($extFoo); $namespace = 'oat\\'.$extFoo->getId().'\\migrations'; $className = $generatorFoo->generateClassName($namespace); $this->assertEquals(0, strpos($className, $namespace)); $postfixPosition = strlen($className) - strlen($extFoo->getId()); $this->assertEquals(substr($className, $postfixPosition), $extFoo->getId()); } }