Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/issue 965 #966

Merged
merged 9 commits into from
Apr 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions includes/lib/Carbon.php
Original file line number Diff line number Diff line change
Expand Up @@ -675,12 +675,13 @@ public function second($value)
* @param integer $hour
* @param integer $minute
* @param integer $second
* @param integer $microseconds
*
* @return static
*/
public function setTime($hour, $minute, $second = 0)
public function setTime($hour, $minute, $second = 0, $microseconds = 0 )
{
parent::setTime($hour, $minute, $second);
parent::setTime($hour, $minute, $second, $microseconds );

return $this;
}
Expand Down
7 changes: 5 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Planes have a black box, WordPress has Stream. When something goes wrong, you ne
**Contributors:** [lukecarbis](https://profiles.wordpress.org/lukecarbis), [fjarrett](https://profiles.wordpress.org/fjarrett), [stream](https://profiles.wordpress.org/stream), [xwp](https://profiles.wordpress.org/xwp)
**Tags:** [wp stream](https://wordpress.org/plugins/tags/wp stream), [stream](https://wordpress.org/plugins/tags/stream), [activity](https://wordpress.org/plugins/tags/activity), [logs](https://wordpress.org/plugins/tags/logs), [track](https://wordpress.org/plugins/tags/track)
**Requires at least:** 3.9
**Tested up to:** 4.8.2
**Stable tag:** 3.2.1
**Tested up to:** 4.8.1
**Stable tag:** 3.2.2
**License:** [GPLv2 or later](https://www.gnu.org/licenses/gpl-2.0.html)

[![Build Status](https://travis-ci.org/xwp/stream.svg?branch=master)](https://travis-ci.org/xwp/stream) [![Join the chat at https://gitter.im/xwp/stream](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/xwp/stream)
Expand Down Expand Up @@ -91,6 +91,9 @@ Thank you for wanting to make Stream better for everyone!

## Changelog ##

### 3.2.2 - September 13, 2017 ###
* Fix: Prevent fatal error when attempting to store an Object in the database.

### 3.2.1 - September 8, 2017 ###
* New: Support for the ACF Options page. ([#931](https://github.com/xwp/stream/pull/931))
* New: Added minimal composer file. ([#932](https://github.com/xwp/stream/pull/932)
Expand Down
7 changes: 5 additions & 2 deletions tests/tests/test-class-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,11 @@ public function test_filter_role_caps() {
$this->assertFalse( $role->has_cap( $this->admin->view_cap ) );
}

/*
/**
* Test Ajax Filters
*
* @group ajax
* @requires PHPUnit 5.7
*/
public function test_ajax_filters() {
$user = new \WP_User( get_current_user_id() );
Expand All @@ -384,7 +387,7 @@ public function test_ajax_filters() {
$_POST['q'] = $user->display_name;
$_POST['nonce'] = wp_create_nonce( 'stream_filters_user_search_nonce' );

$this->setExpectedException( 'WPAjaxDieStopException' );
$this->expectException( 'WPAjaxDieStopException' );

try {
$this->_handleAjax( 'wp_stream_filters' );
Expand Down
15 changes: 13 additions & 2 deletions tests/tests/test-class-alerts.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ function test_load_alert_types() {
$this->assertEquals( 1, $action->get_call_count() );
}

/**
* @requires PHPUnit 5.7
*/
function test_load_bad_alert_type() {
$alerts = new Alerts( $this->plugin );
$alert_types_before_filter = count( $alerts->alert_types );
Expand Down Expand Up @@ -60,6 +63,9 @@ function test_load_alert_triggers() {
$this->assertEquals( 1, $action->get_call_count() );
}

/**
* Test bad trigger is not added.
*/
function test_load_bad_alert_trigger() {
$alerts = new Alerts( $this->plugin );
$alert_triggers_before_filter = count( $alerts->alert_triggers );
Expand All @@ -73,7 +79,7 @@ function test_load_bad_alert_trigger() {
}

function callback_load_bad_alert_register( $classes ) {
$classes['bad_alert_trigger'] = new \stdClass;
$classes['bad_alert_trigger'] = new \stdClass();
return $classes;
}

Expand Down Expand Up @@ -358,14 +364,19 @@ function test_save_new_alert_with_child_context() {
$this->assertObjectHasAttribute( 'success', $response );
$this->assertTrue( $response->success );
}

/**
* @requires PHPUnit 5.7
*/
function test_save_new_alert_no_nonce() {
$alerts = new Alerts( $this->plugin );
try {
$_POST['wp_stream_trigger_author'] = 'me';
$_POST['wp_stream_trigger_context'] = 'posts-post';
$_POST['wp_stream_trigger_action'] = 'edit';
$_POST['wp_stream_alert_type'] = 'highlight';
$this->setExpectedException( 'WPAjaxDieStopException' );

$this->expectException( 'WPAjaxDieStopException' );
$this->_handleAjax( 'save_new_alert' );
} catch ( \WPAjaxDieContinueException $e ) {
$exception = $e;
Expand Down
16 changes: 16 additions & 0 deletions tests/tests/test-class-export.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,22 @@ public function test_register_exporters() {
$this->assertArrayHasKey( 'csv', $this->export->get_exporters() );
}

/**
* Test registering a invalid class type produces an error
* @requires PHPUnit 5.7
*/
public function test_register_exporter_invalid_class() {
add_filter( 'wp_stream_exporters', function( $exporters ) {
$exporters['test'] = new \stdClass();
remove_all_filters( 'wp_stream_exporters' );
return $exporters;
});
$this->export->register_exporters();

$exporters = $this->export->get_exporters();
$this->assertFalse( isset( $exporters['test'] ) );
}

/**
* Test exporter validation
*/
Expand Down