<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[3211] sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory: Plugin Directory: Add unit test scaffolding, and API unit tests.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/3211">3211</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/3211","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>pento</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2016-05-23 02:28:51 +0000 (Mon, 23 May 2016)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Plugin Directory: Add unit test scaffolding, and API unit tests.
Props enej, obenland, pento.
Fixes <a href="http://meta.trac.wordpress.org/ticket/1614">#1614</a>.</pre>
<h3>Added Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryphpunitxml">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/phpunit.xml</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/tests/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectorytestsbootstrapphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/tests/bootstrap.php</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/tests/phpunit/</li>
<li>sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/tests/phpunit/tests/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectorytestsphpunittestswporgpluginapiphp">sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/tests/phpunit/tests/wporg-plugin-api.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectoryphpunitxml"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/phpunit.xml</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/phpunit.xml (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/phpunit.xml 2016-05-23 02:28:51 UTC (rev 3211)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,14 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<phpunit
+ bootstrap="tests/bootstrap.php"
+ backupGlobals="false"
+ colors="true"
+ convertErrorsToExceptions="true"
+ convertNoticesToExceptions="true"
+ convertWarningsToExceptions="true"
+ >
+ <testsuites>
+ <testsuite>
+ <directory suffix=".php">tests/</directory>
+ </testsuite>
+ </testsuites>
+</phpunit>
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/phpunit.xml
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svnexecutable"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:executable</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+*
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectorytestsbootstrapphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/tests/bootstrap.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/tests/bootstrap.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/tests/bootstrap.php 2016-05-23 02:28:51 UTC (rev 3211)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,19 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+$_tests_dir = getenv( 'WP_TESTS_DIR' );
+if ( ! $_tests_dir ) {
+ $_tests_dir = '/tmp/wordpress-tests-lib';
+}
+
+require_once( $_tests_dir . '/includes/functions.php' );
+
+/**
+ * Load the plugin.
+ */
+function _manually_load_plugin_directory_plugin() {
+ require_once( dirname( __FILE__ ) . '/../plugin-directory.php' );
+}
+
+tests_add_filter( 'muplugins_loaded', '_manually_load_plugin_directory_plugin' );
+
+require $_tests_dir . '/includes/bootstrap.php';
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/tests/bootstrap.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svnexecutable"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:executable</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+*
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentpluginsplugindirectorytestsphpunittestswporgpluginapiphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/tests/phpunit/tests/wporg-plugin-api.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/tests/phpunit/tests/wporg-plugin-api.php (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/tests/phpunit/tests/wporg-plugin-api.php 2016-05-23 02:28:51 UTC (rev 3211)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,289 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+
+require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
+
+/**
+ *
+ * @group plugins-api
+ */
+class Tests_Plugins_API extends WP_UnitTestCase {
+
+ public $fields = array(
+ 'short_description' => true,
+ 'description' => true,
+ 'sections' => true,
+ 'tested' => true,
+ 'requires' => true,
+ 'rating' => true,
+ 'ratings' => true,
+ 'downloaded' => true,
+ 'downloadlink' => true,
+ 'last_updated' => true,
+ 'added' => true,
+ 'tags' => true,
+ 'compatibility' => true,
+ 'homepage' => true,
+ 'versions' => true,
+ 'stable_tag' => true,
+ 'donate_link' => true,
+ 'reviews' => true,
+ 'banners' => true,
+ 'icons' => true,
+ 'active_installs' => true,
+ 'group' => true,
+ 'contributors' => true,
+ );
+
+ function test_wporg_plugin_api_serialize_php() {
+ $response = wp_remote_post( 'http://api.wordpress.org/plugins/info/1.0/', array(
+ 'timeout' => 15,
+ 'body' => array(
+ 'action' => 'plugin_information',
+ 'request' => serialize( (object) array( 'slug' => 'jetpack', 'fields' => $this->fields ) ),
+ ),
+ ) );
+ $plugins = maybe_unserialize( wp_remote_retrieve_body( $response ) );
+
+ $this->_check_response_attributes( $plugins );
+ }
+
+ function test_wporg_plugin_api_serialize_php_get() {
+ $url = add_query_arg( 'fields', implode( ',' , array_keys( $this->fields ) ), 'http://api.wordpress.org/plugins/info/1.0/jetpack.php' );
+ $response = wp_remote_get( $url );
+ $plugins = maybe_unserialize( wp_remote_retrieve_body( $response ) );
+
+ $this->_check_response_attributes( $plugins );
+ }
+
+ function test_wporg_plugin_api_xml() {
+ $url = add_query_arg( 'fields', implode( ',' , array_keys( $this->fields ) ), 'http://api.wordpress.org/plugins/info/1.0/jetpack.xml' );
+ $response = wp_remote_get( $url );
+ $plugins = wp_remote_retrieve_body( $response );
+
+ // TODO: validate XML response.
+ $this->markTestSkipped( 'Needs XML parsing.' );
+ $this->_check_response_attributes( $plugins );
+ }
+
+ function test_wporg_plugin_api_json() {
+ $url = add_query_arg( 'fields', implode( ',' , array_keys( $this->fields ) ), 'http://api.wordpress.org/plugins/info/1.0/jetpack.json' );
+ $response = wp_remote_get( $url );
+ $plugins = (object) json_decode( wp_remote_retrieve_body( $response ), true );
+
+ $this->_check_response_attributes( $plugins );
+ }
+
+ function test_wporg_plugin_api_1_1_json() {
+ $response = wp_remote_post( 'http://api.wordpress.org/plugins/info/1.1/', array(
+ 'timeout' => 15,
+ 'body' => array(
+ 'action' => 'plugin_information',
+ 'request' => (object) array( 'slug' => 'jetpack', 'fields' => $this->fields ),
+ ),
+ ) );
+ $plugins = (object) json_decode( wp_remote_retrieve_body( $response ), true );
+
+ $this->_check_response_attributes( $plugins );
+ }
+
+ function test_plugins_api_function_action_plugin_information() {
+ $plugins = plugins_api( 'plugin_information', array( 'slug' => 'jetpack', 'fields' => $this->fields ) );
+ $this->_check_response_attributes( $plugins );
+ }
+
+ function test_plugins_api_function_action_query_plugins_search() {
+ $slug = 'hello-dolly';
+ $per_page = 4;
+ $page = 2;
+ $plugins = plugins_api( 'query_plugins', array(
+ 'search' => $slug,
+ 'per_page' => $per_page,
+ 'page' => $page,
+ 'fields' => $this->fields,
+ ) );
+
+ $this->_check_response_plugin_query( $plugins, $per_page, $page );
+
+ // If search term exactly matches a slug, it should be returned first.
+ $plugins = plugins_api( 'query_plugins', array( 'search' => $slug ) );
+ $this->assertEquals( $plugins->plugins[0]->slug, $slug );
+ }
+
+ // Plugins with a specific tag.
+ function test_plugins_api_function_action_query_plugins_tag() {
+ $tag = 'widget';
+ $plugins = plugins_api( 'query_plugins', array( 'tag' => $tag, 'fields' => $this->fields ) );
+
+ foreach ( $plugins->plugins as $plugin ) {
+ $this->assertArrayHasKey( $tag, $plugin->tags, "Contains tag $tag" );
+ }
+ $this->_check_response_plugin_query( $plugins );
+ }
+
+ // Plugins written by a specific author.
+ function test_plugins_api_function_action_query_plugins_author() {
+ $author = 'wordpressdotorg';
+ $plugins = plugins_api( 'query_plugins', array( 'author' => $author, 'fields' => $this->fields ) );
+
+ foreach ( $plugins->plugins as $plugin ) {
+ $this->assertArrayHasKey( $author, $plugin->contributors, "Contains author $author" );
+ }
+ $this->_check_response_plugin_query( $plugins, 1 );
+ }
+
+ // Favorites.
+ function test_plugins_api_function_action_query_plugins_user() {
+ $plugins = plugins_api( 'query_plugins', array( 'user' => 'markjaquith', 'fields' => $this->fields ) );
+ $this->_check_response_plugin_query( $plugins, 1 );
+ }
+
+ function test_plugins_api_function_action_query_plugins_browse() {
+ $plugins = plugins_api( 'query_plugins', array( 'browse' => 'popular', 'fields' => $this->fields ) );
+ $this->_check_response_plugin_query( $plugins );
+ }
+
+ function test_plugins_api_function_action_query_plugins_installed_plugins() {
+ $plugins = plugins_api( 'query_plugins', array( 'installed_plugins' => array( 'jetpack' ), 'fields' => $this->fields ) );
+ $this->_check_response_plugin_query( $plugins, 1 );
+ }
+
+ function test_plugins_api_function_action_query_plugins_local() {
+ // Not yet implemented. Shouldn't change the structure of the response though.
+ $plugins = plugins_api( 'query_plugins', array( 'local' => 'hello', 'fields' => $this->fields ) );
+ $this->_check_response_plugin_query( $plugins, 1 );
+ }
+
+ function test_plugins_api_function_action_hot_categories() {
+ $number = 2;
+ $plugins = plugins_api( 'hot_categories', array( 'number' => $number ) );
+
+ $this->assertEquals( $number, count( $plugins ) );
+ $this->assertInternalType( 'array', $plugins, 'Response array is array' );
+
+ foreach ( $plugins as $hot_category => $category_array ) {
+ $this->assertInternalType( 'array', $category_array, 'Category array is array' );
+ $this->assertArrayHasKey( 'name', $category_array, 'Name exists' );
+ $this->assertArrayHasKey( 'slug', $category_array, 'Slug exists' );
+
+ // Only check the first result.
+ break;
+ }
+ }
+
+ function test_plugins_api_function_action_hot_tags() {
+ $number = 3;
+ $plugins = plugins_api( 'hot_tags', array( 'number' => $number ) );
+
+ $this->assertEquals( $number, count( $plugins ) );
+ $this->assertInternalType( 'array', $plugins, 'Response array is array' );
+
+ foreach ( $plugins as $hot_tag => $tag_array ) {
+ $this->assertInternalType( 'array', $tag_array, 'Tag array is array' );
+ $this->assertArrayHasKey( 'name', $tag_array, 'Name exists' );
+ $this->assertArrayHasKey( 'slug', $tag_array, 'Slug exists' );
+ $this->assertArrayHasKey( 'count', $tag_array, 'Count exists' );
+
+ // Only check the first result.
+ break;
+ }
+ }
+
+ function _check_response_plugin_query( $plugin_query, $per_page = 24, $page = 1 ) {
+ $this->assertObjectHasAttribute( 'info', $plugin_query, 'Info exists' );
+ $info = $plugin_query->info;
+
+ $this->assertArrayHasKey( 'page', $info, 'Page exists' );
+ $this->assertEquals( $info['page'], $page, 'Page equals to ' . $page );
+
+ $this->assertArrayHasKey( 'pages', $info, 'Pages exists' );
+ $this->assertArrayHasKey( 'results', $info, 'Results exists' );
+
+ // Plugins.
+ $this->assertObjectHasAttribute( 'plugins', $plugin_query, 'Plugins exists' );
+ $this->assertAttributeInternalType( 'array', 'plugins', $plugin_query, 'Plugins should be an array' );
+
+ $this->greaterThanOrEqual( count( $plugin_query->plugins ), $per_page );
+
+ $this->_check_response_attributes( $plugin_query->plugins[0] );
+ }
+
+ function _check_response_attributes( $plugin_info ) {
+ $this->assertObjectHasAttribute( 'name', $plugin_info, 'Name exists' );
+ $this->assertObjectHasAttribute( 'slug', $plugin_info, 'Slug exits' );
+ $this->assertObjectHasAttribute( 'version', $plugin_info, 'Version exists' );
+ $this->assertObjectHasAttribute( 'author', $plugin_info, 'Author exists' );
+ $this->assertObjectHasAttribute( 'author_profile', $plugin_info, 'Author Profile exists' );
+ $this->assertObjectHasAttribute( 'contributors', $plugin_info, 'Contributors exists' );
+ $this->assertAttributeInternalType( 'array', 'contributors', $plugin_info, 'Contributors should be an array' );
+ $this->assertObjectHasAttribute( 'requires', $plugin_info, 'Requires exists' );
+ $this->assertObjectHasAttribute( 'tested', $plugin_info, 'Tested exists' );
+ $this->assertAttributeInternalType( 'string', 'tested', $plugin_info, 'Tested should be a string' );
+ $this->assertObjectHasAttribute( 'compatibility', $plugin_info, 'Compatibility exists' );
+ $this->assertAttributeInternalType( 'array', 'compatibility', $plugin_info, 'Compatibility should be an array' );
+
+ // Ratings.
+ $this->assertObjectHasAttribute( 'rating', $plugin_info, 'Rating exists' );
+ $this->assertObjectHasAttribute( 'ratings', $plugin_info, 'Ratings exists' );
+ $this->assertAttributeInternalType( 'array', 'ratings', $plugin_info, 'Ratings should be an array' );
+ $this->assertArrayHasKey( '1', $plugin_info->ratings, 'Rating should have an attribute of 1' );
+ $this->assertArrayHasKey( '2', $plugin_info->ratings, 'Rating should have an attribute of 2' );
+ $this->assertArrayHasKey( '3', $plugin_info->ratings, 'Rating should have an attribute of 3' );
+ $this->assertArrayHasKey( '4', $plugin_info->ratings, 'Rating should have an attribute of 4' );
+ $this->assertArrayHasKey( '5', $plugin_info->ratings, 'Rating should have an attribute of 5' );
+ $this->assertObjectHasAttribute( 'num_ratings', $plugin_info, 'Num ratings exists' );
+ $this->assertTrue( is_numeric( $plugin_info->num_ratings ), 'Num ratings are numeric' );
+
+ $this->assertObjectHasAttribute( 'active_installs', $plugin_info, 'Active Installs exists' );
+ $this->assertAttributeInternalType( 'integer', 'active_installs', $plugin_info, 'Active Installs should be an integer' );
+ $this->assertObjectHasAttribute( 'downloaded', $plugin_info, 'Active Installs exists' );
+ $this->assertAttributeInternalType( 'integer', 'downloaded', $plugin_info, 'Downloaded should be an integer' );
+
+ $this->assertObjectHasAttribute( 'last_updated', $plugin_info, 'Last Updated exists' );
+ $this->assertAttributeInternalType( 'string', 'last_updated', $plugin_info, 'Last Updated should be a string' );
+ $this->assertObjectHasAttribute( 'added', $plugin_info, 'Added exists' );
+ $this->assertAttributeInternalType( 'string', 'short_description', $plugin_info, 'Added should be a string' );
+
+ if ( function_exists( 'date_create_from_format' ) ) {
+ $last_updated_date = DateTime::createFromFormat( 'Y-m-d g:ia \G\M\T', $plugin_info->last_updated );
+ $date_time_errors = DateTime::getLastErrors();
+ $this->assertTrue( $last_updated_date && 0 == $date_time_errors['warning_count'] && 0 == $date_time_errors['error_count'], 'Last updated has a valid format' );
+
+ $added_date = DateTime::createFromFormat( 'Y-m-d', $plugin_info->added );
+ $date_time_errors = DateTime::getLastErrors();
+ $this->assertTrue( $added_date && 0 == $date_time_errors['warning_count'] && 0 == $date_time_errors['error_count'], 'Added has a valid format' );
+ }
+
+ $this->assertObjectHasAttribute( 'homepage', $plugin_info, 'Homepage exists' );
+ $this->assertAttributeInternalType( 'string', 'homepage', $plugin_info, 'Homepage should be a string' );
+ $this->assertObjectHasAttribute( 'sections', $plugin_info, 'Sections exists' );
+ $this->assertAttributeInternalType( 'array', 'sections', $plugin_info, 'Sections should be an array' );
+
+ $this->assertObjectHasAttribute( 'description', $plugin_info, 'Description exists' );
+ $this->assertAttributeInternalType( 'string', 'description', $plugin_info, 'Description should be a string' );
+ $this->assertObjectHasAttribute( 'short_description', $plugin_info, 'Short Description exists' );
+ $this->assertAttributeInternalType( 'string', 'short_description', $plugin_info, 'Short Description should be a string' );
+
+ $this->assertObjectHasAttribute( 'download_link', $plugin_info, 'Download link exists' );
+ $this->assertAttributeInternalType( 'string', 'download_link', $plugin_info, 'Download link should be a string' );
+ $this->assertFalse( empty( $plugin_info->download_link ), 'Download link should have a value' );
+
+ $this->assertObjectHasAttribute( 'tags', $plugin_info, 'Tags exists' );
+ $this->assertAttributeInternalType( 'array', 'tags', $plugin_info, 'Tags should be an array' );
+
+ $this->assertObjectHasAttribute( 'stable_tag', $plugin_info, 'Stable tag exists' );
+ $this->assertAttributeInternalType( 'string', 'stable_tag', $plugin_info, 'Stable tag should be a string' );
+ $this->assertFalse( empty( $plugin_info->stable_tag ), 'Stable tag should have a value' );
+
+ $this->assertObjectHasAttribute( 'versions', $plugin_info, 'Versions exists' );
+ $this->assertAttributeInternalType( 'array', 'versions', $plugin_info, 'Versions should be an array' );
+
+ $this->assertObjectHasAttribute( 'donate_link', $plugin_info, 'Donate link exists' );
+ $this->assertAttributeInternalType( 'string', 'donate_link', $plugin_info, 'Donate link should be a string' );
+
+ $this->assertObjectHasAttribute( 'banners', $plugin_info, 'Banners exists' );
+ $this->assertAttributeInternalType( 'array', 'banners', $plugin_info, 'Banners should be an array' );
+
+ $this->assertObjectHasAttribute( 'icons', $plugin_info, 'Icons exists' );
+ $this->assertAttributeInternalType( 'array', 'icons', $plugin_info, 'Icons should be an array' );
+ }
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/tests/phpunit/tests/wporg-plugin-api.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svnexecutable"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:executable</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+*
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span></div>
</body>
</html>