Пример #1
0
    public function setUp()
    {
        if (defined('TESTS_Zend_Feed_PubSubHubbub_BASEURI') &&
            \Zend\Uri\Url::check(TESTS_Zend_Feed_PubSubHubbub_BASEURI)) {
            $this->_baseuri = TESTS_Zend_Feed_PubSubHubbub_BASEURI;
            if (substr($this->_baseuri, -1) != '/') $this->_baseuri .= '/';
            $name = $this->getName();
            if (($pos = strpos($name, ' ')) !== false) {
                $name = substr($name, 0, $pos);
            }
            $uri = $this->_baseuri . $name . '.php';
            $this->_adapter = new $this->_config['adapter'];
            $this->_client = new \Zend\Http\Client($uri, $this->_config);
            $this->_client->setAdapter($this->_adapter);
            \Zend\Feed\PubSubHubbub\PubSubHubbub::setHttpClient($this->_client);
            $this->_subscriber = new \Zend\Feed\PubSubHubbub\Subscriber\Subscriber;
            
            
            $this->_storage = $this->_getCleanMock('Zend_Feed_PubSubHubbub_Entity_TopicSubscription');
            $this->_subscriber->setStorage($this->_storage);

        } else {
            // Skip tests
            $this->markTestSkipped("Zend_Feed_PubSubHubbub_Subscriber dynamic tests'
            . ' are not enabled in TestConfiguration.php");
        }
    }