/**
  * Themes column install
  */
 function test_envato_market_themes_column_install()
 {
     if (is_multisite()) {
         $this->markTestSkipped('Cannot properly test envato_market_themes_column() install if on multisite.');
     }
     $themes = array('install' => array(array('id' => 12345, 'name' => 'Twenty Fifteen', 'author' => 'the WordPress team', 'version' => '10.0.0', 'description' => '', 'url' => 'http://sample.org/twentyfifteen/', 'author_url' => 'http://sample.org/', 'thumbnail_url' => 'http://sample.org/thumb.png', 'rating' => array('rating' => 4.79, 'count' => 4457))));
     // Replace private themes reference
     $ref = new ReflectionProperty('Envato_Market_Items', 'themes');
     $ref->setAccessible(true);
     $ref->setValue(null, $themes);
     ob_start();
     envato_market_themes_column('install');
     $contents = ob_get_clean();
     $this->assertContains('Install Twenty Fifteen', $contents);
     $ref = new ReflectionProperty('Envato_Market_Items', 'themes');
     $ref->setAccessible(true);
     $ref->setValue(null, array());
 }
Example #2
0
<?php

/**
 * Themes panel partial
 *
 * @package Envato_Market
 * @since 1.0.0
 */
$themes = envato_market()->items()->themes('purchased');
?>
<div id="themes" class="two-col panel <?php 
echo empty($themes) ? 'hidden' : '';
?>
">
	<?php 
if (!empty($themes)) {
    envato_market_themes_column('active');
    envato_market_themes_column('installed');
    envato_market_themes_column('install');
}
?>
</div>