function setup() { parent::setUp(); $this->_sut = new org_tubepress_impl_http_HttpResponseHandlerChain(); $this->_response = \Mockery::mock(org_tubepress_api_http_HttpResponse::_); $this->_entity = \Mockery::mock(org_tubepress_api_http_HttpEntity::_); }
function setup() { parent::setUp(); $this->_sut = new org_tubepress_impl_http_transferencoding_ChunkedTransferDecoder(); $this->_response = \Mockery::mock(org_tubepress_api_http_HttpResponse::_); $this->_entity = \Mockery::mock(org_tubepress_api_http_HttpEntity::_); }
function setUp() { parent::setUp(); $this->_sut = $this->_getSutInstance(); org_tubepress_impl_log_Log::setEnabled(true, array('tubepress_debug' => 'true')); $this->_server = 'http://tubepress.org/http_tests'; $ioc = org_tubepress_impl_ioc_IocContainer::getInstance(); $mp = $ioc->get(org_tubepress_spi_http_HttpMessageParser::_); $mp->shouldReceive('getHeadersStringFromRawHttpMessage')->andReturnUsing(function ($data) { $x = new org_tubepress_impl_http_DefaultHttpMessageParser(); return $x->getHeadersStringFromRawHttpMessage($data); }); $mp->shouldReceive('getBodyStringFromRawHttpMessage')->andReturnUsing(function ($data) { $x = new org_tubepress_impl_http_DefaultHttpMessageParser(); return $x->getBodyStringFromRawHttpMessage($data); }); $mp->shouldReceive('getArrayOfHeadersFromRawHeaderString')->andReturnUsing(function ($data) { $x = new org_tubepress_impl_http_DefaultHttpMessageParser(); return $x->getArrayOfHeadersFromRawHeaderString($data); }); $mp->shouldReceive('getHeaderArrayAsString')->andReturnUsing(function ($data) { $x = new org_tubepress_impl_http_DefaultHttpMessageParser(); return $x->getHeaderArrayAsString($data); }); }
function setup() { parent::setUp(); $this->_sut = new org_tubepress_impl_provider_SimpleProvider(); $this->_fakeVideo = \Mockery::mock('org_tubepress_api_video_Video'); org_tubepress_impl_log_Log::setEnabled(false, array()); }
function setUp() { parent::setUp(); $this->_sut = new org_tubepress_impl_cache_PearCacheLiteCacheService(); $this->_tempPath = dirname(__FILE__) . '/tmp'; mkdir($this->_tempPath); }
function setup() { parent::setUp(); $this->_sut = $this->buildSut(); $this->_response = \Mockery::mock(org_tubepress_api_http_HttpResponse::_); $this->_entity = \Mockery::mock(org_tubepress_api_http_HttpEntity::_); }
function setUp() { parent::setUp(); $this->tearDown(); $this->_sut = new org_tubepress_impl_filesystem_FsExplorer(); @mkdir('/tmp/tubepress-fs-test'); }
function setUp() { parent::setUp(); $this->_sut = new org_tubepress_impl_player_DefaultPlayerHtmlGenerator(); org_tubepress_impl_log_Log::setEnabled(false, array()); $this->_video = \Mockery::mock('org_tubepress_api_video_Video'); $this->_video->shouldReceive('getId')->once()->andReturn('video-id'); }
function setup() { parent::setUp(); $this->_sut = new org_tubepress_impl_shortcode_SimpleShortcodeParser(); $ioc = org_tubepress_impl_ioc_IocContainer::getInstance(); $context = $ioc->get(org_tubepress_api_exec_ExecutionContext::_); $context->shouldReceive('get')->once()->with(org_tubepress_api_const_options_names_Advanced::KEYWORD)->andReturn('butters'); }
function setUp() { parent::setUp(); $this->_sut = $this->buildSut(); $this->_response = \Mockery::mock(org_tubepress_api_http_HttpResponse::_); $this->_context = new stdClass(); $this->_context->response = $this->_response; }
public function setup() { parent::setUp(); $this->_sut = new org_tubepress_impl_exec_MemoryExecutionContext(); $ioc = org_tubepress_impl_ioc_IocContainer::getInstance(); $this->_validationService = $ioc->get(org_tubepress_api_options_OptionValidator::_); $this->_pluginManager = $ioc->get(org_tubepress_api_plugin_PluginManager::_); }
function setup() { parent::setUp(); $this->_sut = new org_tubepress_impl_plugin_listeners_SkeletonExistsListener(); if (!defined('ABSPATH')) { define('ABSPATH', '/value-of-abspath/'); } }
public function setup() { parent::setUp(); $ioc = org_tubepress_impl_ioc_IocContainer::getInstance(); $this->_messageService = $ioc->get(org_tubepress_api_message_MessageService::_); $this->_messageService->shouldReceive('_')->andReturnUsing(function ($key) { return "<<message: {$key}>>"; }); }
function setup() { $this->_page = 1; parent::setUp(); $this->_sut = new org_tubepress_impl_shortcode_ShortcodeHtmlGeneratorChain(); $ioc = org_tubepress_impl_ioc_IocContainer::getInstance(); $shortcodeParser = $ioc->get(org_tubepress_api_shortcode_ShortcodeParser::_); $shortcodeParser->shouldReceive('parse')->once()->with('shortcode'); }
public function setup() { parent::setUp(); $ioc = org_tubepress_impl_ioc_IocContainer::getInstance(); $ms = $ioc->get(org_tubepress_api_message_MessageService::_); $ms->shouldReceive('_')->andReturnUsing(function ($key) { return "<<message: {$key}>>"; }); $this->_sut = new org_tubepress_impl_options_ui_tabs_GallerySourceTab(); }
function setUp() { parent::setUp(); $this->_sut = new org_tubepress_impl_ioc_FreeWordPressPluginIocService(); if (!self::$_booted) { self::$_booted = true; $this->_setupEveryInterfaceIsBound(); } $this->_expectedMapping = array('org_tubepress_api_bootstrap_Bootstrapper' => 'org_tubepress_impl_bootstrap_TubePressBootstrapper', 'org_tubepress_api_cache_Cache' => 'org_tubepress_impl_cache_PearCacheLiteCacheService', 'org_tubepress_api_embedded_EmbeddedHtmlGenerator' => 'org_tubepress_impl_embedded_EmbeddedPlayerChain', 'org_tubepress_api_environment_Detector' => 'org_tubepress_impl_environment_SimpleEnvironmentDetector', 'org_tubepress_api_factory_VideoFactory' => 'org_tubepress_impl_factory_VideoFactoryChain', 'org_tubepress_api_feed_FeedFetcher' => 'org_tubepress_impl_feed_CacheAwareFeedFetcher', 'org_tubepress_api_feed_FeedInspector' => 'org_tubepress_impl_feed_FeedInspectorChain', 'org_tubepress_api_filesystem_Explorer' => 'org_tubepress_impl_filesystem_FsExplorer', 'org_tubepress_api_html_HeadHtmlGenerator' => 'org_tubepress_impl_html_DefaultHeadHtmlGenerator', 'org_tubepress_api_http_HttpClient' => 'org_tubepress_impl_http_HttpClientChain', 'org_tubepress_api_http_HttpRequestParameterService' => 'org_tubepress_impl_http_DefaultHttpRequestParameterService', 'org_tubepress_api_message_MessageService' => 'org_tubepress_impl_message_WordPressMessageService', 'org_tubepress_api_exec_ExecutionContext' => 'org_tubepress_impl_exec_MemoryExecutionContext', 'org_tubepress_api_options_OptionValidator' => 'org_tubepress_impl_options_SimpleOptionValidator', 'org_tubepress_api_options_StorageManager' => 'org_tubepress_impl_options_WordPressStorageManager', 'org_tubepress_api_plugin_PluginManager' => 'org_tubepress_impl_plugin_PluginManagerImpl', 'org_tubepress_spi_patterns_cor_Chain' => 'org_tubepress_impl_patterns_cor_ChainGang', 'org_tubepress_api_player_PlayerHtmlGenerator' => 'org_tubepress_impl_player_DefaultPlayerHtmlGenerator', 'org_tubepress_api_provider_Provider' => 'org_tubepress_impl_provider_SimpleProvider', 'org_tubepress_api_provider_ProviderCalculator' => 'org_tubepress_impl_provider_SimpleProviderCalculator', 'org_tubepress_api_querystring_QueryStringService' => 'org_tubepress_impl_querystring_SimpleQueryStringService', 'org_tubepress_api_shortcode_ShortcodeHtmlGenerator' => 'org_tubepress_impl_shortcode_ShortcodeHtmlGeneratorChain', 'org_tubepress_api_shortcode_ShortcodeParser' => 'org_tubepress_impl_shortcode_SimpleShortcodeParser', 'org_tubepress_api_template_TemplateBuilder' => 'org_tubepress_impl_template_SimpleTemplateBuilder', 'org_tubepress_api_theme_ThemeHandler' => 'org_tubepress_impl_theme_SimpleThemeHandler', 'org_tubepress_api_feed_UrlBuilder' => 'org_tubepress_impl_feed_UrlBuilderChain'); }
function setUp() { parent::setUp(); $this->_sut = new org_tubepress_impl_feed_urlbuilding_VimeoUrlBuilderCommand(); $ioc = org_tubepress_impl_ioc_IocContainer::getInstance(); $pc = $ioc->get(org_tubepress_api_provider_ProviderCalculator::_); $pc->shouldReceive('calculateProviderOfVideoId')->zeroOrMoreTimes()->andReturn(org_tubepress_api_provider_Provider::VIMEO); $execContext = $ioc->get(org_tubepress_api_exec_ExecutionContext::_); $execContext->shouldReceive('get')->zeroOrMoreTimes()->with(org_tubepress_api_const_options_names_Thumbs::RESULTS_PER_PAGE)->andReturn(20); }
function setUp() { parent::setUp(); $this->_sut = new FakeHttpTransport(); $this->_context = new stdClass(); $this->_request = \Mockery::mock(org_tubepress_api_http_HttpRequest::_); $this->_request->shouldReceive('__toString')->andReturn('request as string'); $this->_context->request = $this->_request; ob_start(); }
function setup() { parent::setUp(); $this->_sut = new org_tubepress_impl_http_HttpClientChain(); $this->_request = \Mockery::mock(org_tubepress_api_http_HttpRequest::_); $this->_response = new org_tubepress_api_http_HttpResponse(); $this->_url = \Mockery::mock(org_tubepress_api_url_Url::_); $this->_context = new stdClass(); $this->_actualCommands = array('org_tubepress_impl_http_transports_ExtHttpTransport', 'org_tubepress_impl_http_transports_CurlTransport', 'org_tubepress_impl_http_transports_StreamsTransport', 'org_tubepress_impl_http_transports_FsockOpenTransport'); $this->_chain = null; }
public function setup() { parent::setUp(); $ioc = org_tubepress_impl_ioc_IocContainer::getInstance(); $themeHandler = $ioc->get(org_tubepress_api_theme_ThemeHandler::_); $explorer = $ioc->get(org_tubepress_api_filesystem_Explorer::_); $themeHandler->shouldReceive('getUserContentDirectory')->once()->andReturn('user-content-dir'); $explorer->shouldReceive('getTubePressBaseInstallationPath')->once()->andReturn('base-install-path'); $explorer->shouldReceive('getDirectoriesInDirectory')->once()->with('base-install-path/sys/ui/themes', 'Default Option Descriptor Reference')->andReturn(array('boo')); $explorer->shouldReceive('getDirectoriesInDirectory')->once()->with('user-content-dir/themes', 'Default Option Descriptor Reference')->andReturn(array('bob')); $this->_sut = new org_tubepress_impl_options_DefaultOptionDescriptorReference(); }
function setUp() { parent::setUp(); $get_option = new PHPUnit_Extensions_MockFunction('get_option'); $get_option->expects($this->any())->will($this->returnCallback(array($this, 'callback'))); $update_option = new PHPUnit_Extensions_MockFunction('update_option'); $this->setupInit(); $this->_sut = new org_tubepress_impl_options_WordPressStorageManager(); $ioc = org_tubepress_impl_ioc_IocContainer::getInstance(); $validator = $ioc->get(org_tubepress_api_options_OptionValidator::_); $validator->shouldReceive('isValid')->andReturn(true); $this->_sut->init(); }
function setUp() { parent::setUp(); $this->_sut = new org_tubepress_impl_feed_urlbuilding_YouTubeUrlBuilderCommand(); $ioc = org_tubepress_impl_ioc_IocContainer::getInstance(); $pc = $ioc->get(org_tubepress_api_provider_ProviderCalculator::_); $pc->shouldReceive('calculateProviderOfVideoId')->zeroOrMoreTimes()->andReturn(org_tubepress_api_provider_Provider::YOUTUBE); $execContext = $ioc->get(org_tubepress_api_exec_ExecutionContext::_); $execContext->shouldReceive('get')->zeroOrMoreTimes()->with(org_tubepress_api_const_options_names_Thumbs::RESULTS_PER_PAGE)->andReturn(20); $execContext->shouldReceive('get')->zeroOrMoreTimes()->with(org_tubepress_api_const_options_names_Feed::ORDER_BY)->andReturn('viewCount'); $execContext->shouldReceive('get')->zeroOrMoreTimes()->with(org_tubepress_api_const_options_names_Feed::FILTER)->andReturn('moderate'); $execContext->shouldReceive('get')->zeroOrMoreTimes()->with(org_tubepress_api_const_options_names_Feed::EMBEDDABLE_ONLY)->andReturn(true); $execContext->shouldReceive('get')->zeroOrMoreTimes()->with(org_tubepress_api_const_options_names_Feed::DEV_KEY)->andReturn('AI39si5uUzupiQW9bpzGqZRrhvqF3vBgRqL-I_28G1zWozmdNJlskzMDQEhpZ-l2RqGf_6CNWooL96oJZRrqKo-eJ9QO_QppMg'); }
public function setup() { parent::setUp(); $this->_sut = new org_tubepress_impl_options_ui_DefaultTabsHandler(); $ioc = org_tubepress_impl_ioc_IocContainer::getInstance(); $gal = $ioc->get(org_tubepress_impl_options_ui_tabs_GallerySourceTab::_); $tab = $ioc->get('org_tubepress_impl_options_ui_tabs_ThumbsTab'); $emb = $ioc->get(org_tubepress_impl_options_ui_tabs_EmbeddedTab::_); $met = $ioc->get(org_tubepress_impl_options_ui_tabs_MetaTab::_); $thm = $ioc->get(org_tubepress_impl_options_ui_tabs_ThemeTab::_); $fee = $ioc->get(org_tubepress_impl_options_ui_tabs_FeedTab::_); $cah = $ioc->get(org_tubepress_impl_options_ui_tabs_CacheTab::_); $adv = $ioc->get('org_tubepress_impl_options_ui_tabs_AdvancedTab'); $this->_expectedTabs = array($gal, $tab, $adv, $cah, $emb, $thm, $fee, $met); }
public function setup() { parent::setUp(); $this->_sut = new org_tubepress_impl_plugin_filters_gallerytemplate_Pagination(); $ioc = org_tubepress_impl_ioc_IocContainer::getInstance(); $this->_hrps = $ioc->get(org_tubepress_api_http_HttpRequestParameterService::_); $this->_execContext = $ioc->get(org_tubepress_api_exec_ExecutionContext::_); $this->_execContext->shouldReceive('get')->once()->with(org_tubepress_api_const_options_names_Thumbs::PAGINATE_ABOVE)->andReturn(true); $this->_execContext->shouldReceive('get')->once()->with(org_tubepress_api_const_options_names_Thumbs::PAGINATE_BELOW)->andReturn(true); $this->_execContext->shouldReceive('get')->once()->with(org_tubepress_api_const_options_names_Thumbs::RESULTS_PER_PAGE)->andReturn(4); $this->_providerResult = \Mockery::mock('org_tubepress_api_provider_ProviderResult'); $this->_providerResult->shouldReceive('getEffectiveTotalResultCount')->once()->andReturn(500); $this->_mockTemplate = \Mockery::mock('org_tubepress_api_template_Template'); $this->_mockTemplate->shouldReceive('setVariable')->once()->with(org_tubepress_api_const_template_Variable::PAGINATION_TOP, 'pagination-html'); $this->_mockTemplate->shouldReceive('setVariable')->once()->with(org_tubepress_api_const_template_Variable::PAGINATION_BOTTOM, 'pagination-html'); $this->_qss = $ioc->get(org_tubepress_api_querystring_QueryStringService::_); $this->_qss->shouldReceive('getFullUrl')->once()->andReturn('http://tubepress.org'); $messageService = $ioc->get(org_tubepress_api_message_MessageService::_); $messageService->shouldReceive('_')->atLeast()->once()->andReturnUsing(function ($msg) { return "##{$msg}##"; }); $this->_pluginManager = $ioc->get(org_tubepress_api_plugin_PluginManager::_); }
function setUp() { parent::setUp(); $this->_sut = new org_tubepress_impl_environment_SimpleEnvironmentDetector(); }
function setUp() { parent::setUp(); $this->_sut = new org_tubepress_impl_feed_CacheAwareFeedFetcher(); org_tubepress_impl_log_Log::setEnabled(false, array()); }
function setUp() { parent::setUp(); $this->_sut = new org_tubepress_impl_factory_commands_VimeoFactoryCommand(); $this->_multipleFeed = file_get_contents(dirname(__FILE__) . '/../feeds/vimeo.txt'); }
function setup() { parent::setUp(); $this->_sut = new org_tubepress_impl_plugin_filters_providerresult_PerPageSorter(); $this->_buildVideos(); }
function setup() { parent::setUp(); $this->_sut = new org_tubepress_impl_plugin_filters_galleryinitjs_GalleryInitJsBaseParams(); }
function setup() { parent::setUp(); $this->_sut = new org_tubepress_impl_shortcode_commands_SearchOutputCommand(); }