Skip to content

Commit

Permalink
Flush everything
Browse files Browse the repository at this point in the history
  • Loading branch information
GlazerMann authored Dec 20, 2024
2 parents 2367048 + b8a4f9f commit 38d6851
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions tests/testBaseClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function __construct() {
$this->testing_skip_bibcode = false;
}
if (!getenv('PHP_OAUTH_CONSUMER_TOKEN') || !getenv('PHP_OAUTH_CONSUMER_SECRET') ||
!getenv('PHP_OAUTH_ACCESS_TOKEN') || !getenv('PHP_OAUTH_ACCESS_SECRET')) {
!getenv('PHP_OAUTH_ACCESS_TOKEN') || !getenv('PHP_OAUTH_ACCESS_SECRET')) {
$this->testing_skip_wiki = true;
} else {
$this->testing_skip_wiki = false;
Expand Down Expand Up @@ -96,13 +96,13 @@ protected function requires_bibcode(callable $function): void {

// Speeds up non-zotero tests
protected function requires_zotero(callable $function): void {
try {
usleep(300000); // Reduce failures
Zotero::unblock_zotero();
$function();
} finally {
Zotero::block_zotero();
}
try {
usleep(300000); // Reduce failures
Zotero::unblock_zotero();
$function();
} finally {
Zotero::block_zotero();
}
}

protected function make_citation(string $text): Template {
Expand Down Expand Up @@ -179,11 +179,14 @@ protected function reference_to_template(string $text): Template {
}

protected function flush(): void {
if (ob_get_level() > 0) {
ob_end_flush();
ob_start();
}
flush();
$level = ob_get_level();
for ($count = 0; $count < $level; $count++) {
ob_end_flush();
}
flush();
for ($count = 0; $count < $level; $count++) {
ob_start();
}
}

protected function fill_cache(): void { // Name is outdated
Expand Down

0 comments on commit 38d6851

Please sign in to comment.