Основа пророчества и друпал 7
Я пытаюсь создать тест с использованием Phpunit и издеваться над Prophecy, но получаю исключение MethodNotFoundException. Это мой код:
<?php
namespace Drupal\forum_innovation\Tests;
use Prophecy;
/**
* Test the ForumCounter Class.
* @coversDefaultClass \Drupal\forum_innovation\Forum
* @group utility
*/
class ForumCounterTest extends \PHPUnit_Framework_TestCase {
/**
* @covers::setForumCounter
*/
public function testSetForumCounter() {
$prophet = new Prophecy\Prophet;
$set_counter = $prophet->prophesize('Drupal\forum_innovation\Forum\ForumCounter');
$set_counter->setForumCounter(83, 3024)->willReturn(TRUE);
$stub = $set_counter->reveal();
}
}
Я выполняю тест из командной строки и получаю эту ошибку:
Это класс и методы, которые я хочу проверить:
<?php
namespace Drupal\forum_innovation\Forum;
class ForumCounter implements ForumInterface {
public static function setForumCounter($forum, $uid) {
$counterState = db_update('forum_counter_states')
->fields(array(
'state' => 'read',
))
->condition('uid', $uid)
->condition('tid', $forum)
->execute();
return $counterState;
}
}
Я не знаю, что не так с тестом, поэтому любая помощь будет благодарна. Благодарю.