Social\Plugin\AddThisWidgetTest::setUp PHP Method

setUp() public method

public setUp ( )
    public function setUp()
    {
        $this->addthis = Mockery::mock('Social\\Model\\AddThis');
        $this->addthis->shouldReceive('getConfig')->once()->andReturn(array('profile_id' => '', 'username' => '', 'password' => '', 'show_stats' => '1', 'language' => 'fr', 'data_ga_property_id' => 'test', 'data_track_clickback' => '1', 'data_track_addressbar' => '1', 'config_json' => '', 'widgets' => array(array('name' => 'blog', 'identifier' => 'custom_string', 'settings' => 'custom_string', 'custom_string' => '<!-- AddThis Button BEGIN -->' . '<div class="addthis_toolbox addthis_default_style">' . '<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>' . '<a class="addthis_button_tweet"></a>' . '<a class="addthis_button_pinterest_pinit" pi:pinit:layout="horizontal"></a>' . '<a class="addthis_counter addthis_pill_style"></a>' . '</div>', 'chosen_list' => ''), array('name' => 'something', 'identifier' => 'something', 'settings' => 'nothing', 'custom_string' => '', 'chosen_list' => ''), array('name' => 'large_toolbox', 'identifier' => 'large_toolbox', 'settings' => 'large_toolbox', 'custom_string' => '', 'chosen_list' => 'facebook, twitter, pinterest_share, advqr, google_plusone_share, compact, counter'), array('name' => 'fb_tw_p1_sc', 'identifier' => 'fb_tw_p1_sc', 'settings' => 'fb_tw_p1_sc', 'custom_string' => '', 'chosen_list' => 'facebook, twitter, pinterest_share, google_plusone, google_plusone_share, compact, counter'), array('name' => 'large_toolbox_without_chosen_list', 'identifier' => 'large_toolbox_without_chosen_list', 'settings' => 'large_toolbox', 'custom_string' => '', 'chosen_list' => ''), array('name' => 'small_toolbox', 'identifier' => 'small_toolbox', 'settings' => 'small_toolbox', 'custom_string' => '', 'chosen_list' => 'facebook, twitter, pinterest_share, advqr, google_plusone_share, compact, counter')), 'addthis_show_stats' => true, 'addthis_append_data' => true, 'addthis_copytracking1' => false, 'addthis_copytracking2' => false, 'addthis_brand' => '', 'addthis_language' => 'fr', 'custom_size' => '', 'custom_services' => '', 'custom_preferred' => '', 'custom_more' => '', 'custom_string' => '', 'json_config' => '{"language":"fr"}'));
        $this->addthis->shouldReceive('getDefaultStyles')->once()->andReturn(array('large_toolbox' => array('src' => '<div class="addthis_toolbox addthis_default_style addthis_32x32_style" %1$s>' . '<a class="addthis_button_facebook"></a><a class="addthis_button_twitter"></a>' . '<a class="addthis_button_email"></a><a class="addthis_button_pinterest_share"></a>' . '<a class="addthis_button_compact"></a><a class="addthis_counter addthis_bubble_style">' . '</a></div>', 'img' => 'toolbox-large.png', 'name' => 'Large Toolbox'), 'small_toolbox' => array('src' => '<div class="addthis_toolbox addthis_default_style addthis_" %1$s>' . '<a class="addthis_button_facebook"></a><a class="addthis_button_twitter"></a>' . '<a class="addthis_button_email"></a><a class="addthis_button_pinterest_share"></a>' . '<a class="addthis_button_compact"></a><a class="addthis_counter addthis_bubble_style">' . '</a></div>', 'img' => 'toolbox-small.png', 'name' => 'Small Toolbox'), 'fb_tw_p1_sc' => array('src' => '<div class="addthis_toolbox addthis_default_style" %1$s>' . '<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>' . '<a class="addthis_button_tweet"></a><a class="addthis_button_pinterest_pinit"></a>' . '<a class="addthis_counter addthis_pill_style"></a></div>', 'img' => 'horizontal_share_rect.png', 'name' => 'Like, Tweet, +1, Share'), 'button' => array('src' => '<div><a class="addthis_button" href="//addthis.com/bookmark.php?v=' . Model\AddThis::ADDTHIS_VERSION . '" %1$s><img src="//cache.addthis.com/cachefly/' . 'static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" ' . 'style="border:0"/></a></div>', 'img' => 'horizontal_share.png', 'name' => 'Classic Share Button'), 'custom_string' => array('name' => 'Custom string')));
        $serviceManager = Registry::get('Application')->getServiceManager();
        $serviceManager->setAllowOverride(true);
        $serviceManager->setService('CurrentDocument', DocumentModel::fromArray(array('id' => 1, 'url_key' => 'test', 'name' => 'Test')));
        $serviceManager->setService('AddThisModel', $this->addthis);
        $serviceManager->setAllowOverride(false);
        $this->object = new AddThisWidget();
    }