Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #20 from felipeelia/issue-19
Browse files Browse the repository at this point in the history
PHP 7.4 Compatibility
  • Loading branch information
jeffpaul authored Mar 12, 2020
2 parents 3857611 + d1e3fd5 commit 673a501
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/classes/PHPUnit/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
namespace WPAcceptance\PHPUnit;

use WPAcceptance\EnvironmentFactory;
use WPAcceptance\Log;

/**
* Database trait
Expand All @@ -17,7 +18,7 @@ trait Database {
/**
* Get the last INSERT, UPDATE, or DELETE that happened in the MySQL server
*
* @return array
* @return array|null
*/
protected function getLastModifyingQuery() {
$mysql = EnvironmentFactory::get()->getMySQLClient();
Expand Down
2 changes: 1 addition & 1 deletion src/classes/PHPUnit/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function tearDown() {

$new_last_modifying_query = $this->getLastModifyingQuery();

if ( ! empty( $new_last_modifying_query ) && $new_last_modifying_query['event_time'] !== $this->last_modifying_query['event_time'] ) {
if ( ! empty( $this->last_modifying_query ) && ! empty( $new_last_modifying_query ) && $new_last_modifying_query['event_time'] !== $this->last_modifying_query['event_time'] ) {
Log::instance()->write( 'Test modified the database (' . $this->getName() . ').', 1, 'warning' );
Log::instance()->write( 'Last query at ' . $new_last_modifying_query['event_time'] . ': ' . $new_last_modifying_query['argument'], 2 );

Expand Down

0 comments on commit 673a501

Please sign in to comment.