Skip to content

Commit

Permalink
#17 Adding unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
hughdevore committed Aug 14, 2017
1 parent 7a5b928 commit 598668c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Type/MediaItem/Mutation/MediaItemUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static function mutate( \WP_Post_Type $post_type_object ) {
/**
* If there's no existing mediaItem, throw an exception
*/
if ( empty( $id_parts['id'] ) || false === $existing_media_item ) {
if ( empty( $id_parts['id'] ) || null === $existing_media_item ) {
throw new \Exception( __( 'No mediaItems could be found to update', 'wp-graphql' ) );
}

Expand Down
2 changes: 1 addition & 1 deletion tests/test-media-item-mutations.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ public function updateMediaItemMutation() {
* @return void
*/
public function testUmiInvalidId() {
$this->update_variables['input']['id'] = 12345;
$this->update_variables['input']['id'] = '12345';
$actual = $this->updateMediaItemMutation();
$this->assertArrayHasKey( 'errors', $actual );
$variables['input']['id'] = $this->media_item_id;
Expand Down

0 comments on commit 598668c

Please sign in to comment.