Skip to content

Commit

Permalink
ajust method for getting post info
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Silverstein committed Apr 9, 2019
1 parent 738a562 commit 5e4b865
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tests/wpacceptance/includes/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,14 @@ protected function pushPost( \WPAcceptance\PHPUnit\Actor $I, $post_id, $to_conne

$info['distributed_front_url'] = $I->getCurrentUrl();

$I->click( '#wp-admin-bar-edit a' );

$I->waitUntilNavigation();

$info['distributed_edit_url'] = $I->getCurrentUrl();

$info['distributed_post_id'] = (int) $I->getElementAttribute( '#post_ID', 'value' );
try {
$link = $I->getElementAttribute( '#wp-admin-bar-edit a', 'href' );
$info['distributed_edit_url'] = $link;
preg_match( 'post=(\\d)+', $link, $matches );
if ( $matches ) {
$info['distributed_post_id'] = (int) $matches[1];
}
} catch ( \Exception $e ) {}
}

return $info;
Expand Down

0 comments on commit 5e4b865

Please sign in to comment.