Skip to content

Commit

Permalink
chore: prepare release for 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Waldstein authored and Jon Waldstein committed May 15, 2024
1 parent f6705d7 commit ad47bc9
Show file tree
Hide file tree
Showing 12 changed files with 126 additions and 499 deletions.
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@
"install-codestandards": [
"Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run"
],
"test:unit": "phpunit"
"test": "./vendor/bin/phpunit --colors --stop-on-failure"
},
"autoload": {
"psr-4": {
"GiveDivi\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"GiveDivi\\Tests\\": "tests/"
}
},
"config": {
"platform": {
"php": "7.2"
Expand Down
2 changes: 1 addition & 1 deletion give-divi.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin URI: https://go.givewp.com/divi-addon
* Description: Use GiveWP shortcodes as Divi modules
* Version: 2.0.0
* Requires at least: 6.0
* Requires at least: 6.3
* Requires PHP: 7.2
* Author: GiveWP
* Author URI: https://givewp.com/
Expand Down
50 changes: 19 additions & 31 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,33 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap="tests/unit/bootstrap.php"
backupGlobals="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
verbose="true"
syntaxCheck="true"
>
<testsuites>
<testsuite name="Give Test Suite">
<directory suffix="Test.php">./tests/unit/tests</directory>
</testsuite>
</testsuites>
<filter>
<blacklist>
<directory suffix=".php">./templates/</directory>
<directory suffix=".php">./tests/</directory>
<directory suffix=".php">./tmp/</directory>
<directory suffix=".php">./languages/</directory>
<directory suffix=".php">./tests/</directory>
<directory suffix=".php">./templates/</directory>
<directory suffix=".php">./includes/libraries/</directory>
<directory suffix=".php">./includes/admin/tools/export</directory>
<directory suffix=".php">./includes/admin/reporting/tools/</directory>
</blacklist>
</filter>
<logging>
<log type="coverage-clover" target="./tmp/clover.xml" charset="UTF-8" />
</logging>
</phpunit>
bootstrap="tests/bootstrap.php"
backupGlobals="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
verbose="true"
>
<testsuites>
<testsuite name="Unit Tests">
<directory suffix="Test.php">./tests/Unit</directory>
<directory prefix="Test" suffix=".php">./tests/Unit</directory>
</testsuite>
<testsuite name="Feature Tests">
<directory suffix="Test.php">./tests/Feature</directory>
<directory prefix="Test" suffix=".php">./tests/Feature</directory>
</testsuite>
</testsuites>
</phpunit>
6 changes: 3 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Contributors: givewp, dlocc, webdevmattcrom, jason_the_adams
Donate link: https://givewp.com/
Tags: givewp, donation, divi, divi modules, fundraising
Requires at least: 6.0
Tested up to: 6.4
Requires at least: 6.3
Tested up to: 6.5
Requires PHP: 7.2
Stable tag: 2.0.0
Requires Give: 3.0.0
Expand Down Expand Up @@ -94,7 +94,7 @@ Automatic updates should work like a charm; as always though, ensure you back up

== Changelog ==

### 2.0.0 February 12th, 2024 ###
### 2.0.0 May 15th, 2024 ###
* New: Added compatibility with the GiveWP visual form builder

### 1.0.3 March 3rd, 2022 ###
Expand Down
90 changes: 90 additions & 0 deletions tests/Unit/TestGiveDivi.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?php

namespace GiveDivi\Tests;

use Give\Tests\TestCase;

use GiveDivi\Addon\Environment;

/**
* @since 2.0.0
*/
class TestGiveDivi extends TestCase
{
/**
* @since 2.0.0
*/
public function testReadMeVersionMatchesPluginVersion(): void
{
$readme = get_file_data(
trailingslashit(GIVE_DIVI_ADDON_DIR) . "readme.txt",
[
"Version" => "Stable tag"
]
);

$plugin = get_plugin_data(GIVE_DIVI_ADDON_FILE);

$this->assertEquals(GIVE_DIVI_ADDON_VERSION, $readme['Version']);
$this->assertEquals(GIVE_DIVI_ADDON_VERSION, $plugin['Version']);
$this->assertEquals($readme['Version'], $plugin['Version']);
}

/**
* @since 2.0.0
*/
public function testHasMinimumGiveWPVersion(): void
{
$this->assertSame('3.0.0', GIVE_DIVI_ADDON_MIN_GIVE_VERSION);
}

/**
* @since 2.0.0
*/
public function testIsCompatibleWithGiveWP(): void
{
$this->assertFalse(version_compare(GIVE_VERSION, GIVE_DIVI_ADDON_MIN_GIVE_VERSION, '<'));
}

/**
* @since 2.0.0
*/
public function testCheckRequirementsShouldReturnTrue(): void
{
$this->assertTrue(Environment::giveMinRequiredVersionCheck());
}

/**
* @since 2.0.0
*/
public function testReadMeRequiresPHPVersionMatchesPluginVersion(): void
{
$readme = get_file_data(
trailingslashit(GIVE_DIVI_ADDON_DIR) . "readme.txt",
[
"RequiresPHP" => "Requires PHP"
]
);

$plugin = get_plugin_data(GIVE_DIVI_ADDON_FILE);

$this->assertEquals($plugin['RequiresPHP'], $readme['RequiresPHP']);
}

/**
* @since 2.0.0
*/
public function testReadMeRequiresWPVersionMatchesPluginHeaderVersion(): void
{
$readme = get_file_data(
trailingslashit(GIVE_DIVI_ADDON_DIR) . "readme.txt",
[
"RequiresWP" => "Requires at least"
]
);

$plugin = get_plugin_data(GIVE_DIVI_ADDON_FILE);

$this->assertEquals($plugin['RequiresWP'], $readme['RequiresWP']);
}
}
7 changes: 7 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

use Give\Tests\Framework\Addons\Bootstrap;

require __DIR__ . '/../../give/vendor/autoload.php';

(new Bootstrap(__DIR__ . '/../give-divi.php'))->load();
67 changes: 0 additions & 67 deletions tests/unit/README.md

This file was deleted.

112 changes: 0 additions & 112 deletions tests/unit/bin/install.sh

This file was deleted.

Loading

0 comments on commit ad47bc9

Please sign in to comment.