Skip to content

Commit

Permalink
Merge pull request #2068 from the-events-calendar/fix/TEC-5071-event-…
Browse files Browse the repository at this point in the history
…automator-upsell-link-bug

TEC-5071: missing dir and filename for event automator
  • Loading branch information
pattihis authored Apr 15, 2024
2 parents fc64549 + dddf1b5 commit 1808755
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 3 deletions.
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
== Changelog ==

= [TBD] TBD =

* Fix - Add dir/filename of `event-automator` in the Plugins_API to fix CTA button text/links in the Help section. [TEC-5071]

= [5.2.5] 2024-04-09 =

Expand Down
5 changes: 3 additions & 2 deletions src/Tribe/Plugins_API.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ public function get_products() {
'title' => __( 'Event Automator', 'tribe-common' ),
'slug' => 'event-automator',
'link' => 'https://evnt.is/1bc7',
'plugin-dir' => '',
'main-file' => '',
'plugin-dir' => 'event-automator',
'main-file' => 'event-automator.php',
'description' => __( 'Automate your event workflow with Zapier—no code required!', 'tribe-common' ),
'description-help' => __( 'Connect The Events Calendar and Event Tickets with thousands of the most popular apps.', 'tribe-common' ),
'features' => [
Expand Down Expand Up @@ -250,6 +250,7 @@ public function get_products() {
'plugin-dir' => 'image-widget-plus',
'main-file' => 'image-widget-plus.php',
'description' => __( 'Beautiful display options for your favorite photos.', 'tribe-common' ),
'description-help' => __( 'Beautiful display options for your favorite photos.', 'tribe-common' ),
'features' => [
__( 'Multi-Image Support', 'tribe-common' ),
__( 'Lightbox', 'tribe-common' ),
Expand Down
2 changes: 1 addition & 1 deletion src/resources/postcss/utilities
73 changes: 73 additions & 0 deletions tests/wpunit/Tribe/Plugins_APITest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?php
namespace Tribe;

use Tribe__Plugins_API as API;

class PluginsAPITest extends \Codeception\TestCase\WPTestCase { // phpcs:ignore

/**
* @test
* it should be instantiatable
*/
public function it_should_be_instantiatable() {
$sut = $this->make_instance();

$this->assertInstanceOf( API::class, $sut );
}

/**
* @test
* test the array of our products and their properties
*/
public function our_plugins_must_define_all_properties() {
$sut = $this->make_instance();

$products = $sut->get_products();

$this->assertNotEmpty( $products );
$this->assertIsArray( $products );

foreach ( $products as $product ) {
$this->assertArrayHasKey( 'title', $product );
$this->assertArrayHasKey( 'slug', $product );
$this->assertArrayHasKey( 'link', $product );
$this->assertArrayHasKey( 'plugin-dir', $product );
$this->assertArrayHasKey( 'main-file', $product );
$this->assertArrayHasKey( 'description', $product );
$this->assertArrayHasKey( 'description-help', $product );
$this->assertArrayHasKey( 'features', $product );
$this->assertArrayHasKey( 'image', $product );
$this->assertArrayHasKey( 'logo', $product );
$this->assertArrayHasKey( 'is_installed', $product );
$this->assertArrayHasKey( 'free', $product );
$this->assertArrayHasKey( 'active_installs', $product );
}

$services = [ 'promoter', 'event-aggregator' ];

foreach ( $products as $product ) {
$this->assertNotEmpty( $product['title'] );
$this->assertNotEmpty( $product['slug'] );
$this->assertNotEmpty( $product['link'] );
if ( ! in_array( $product['slug'], $services ) ) {
$this->assertNotEmpty( $product['plugin-dir'] );
$this->assertNotEmpty( $product['main-file'] );
}
$this->assertNotEmpty( $product['description'] );
$this->assertNotEmpty( $product['description-help'] );
$this->assertNotEmpty( $product['features'] );
$this->assertNotEmpty( $product['image'] );
$this->assertNotEmpty( $product['logo'] );
$this->assertIsBool( $product['is_installed'] );
$this->assertIsBool( $product['free'] );
$this->assertIsInt( $product['active_installs'] );
}
}

/**
* @return API
*/
private function make_instance() {
return new API();
}
}

0 comments on commit 1808755

Please sign in to comment.