Open Rudloff opened 5 years ago
For the purposes of testing, I believe you can mock out the function by doing something like this in your test file:
<?php
namespace Barracuda\ArchiveStream {
function ob_end_clean()
{
}
}
namespace my\test\namespace {
# Test code that invokes ArchiveStream here
}
This overrides ob_end_clean
with a no-op function inside the ArchiveStream namespace so you won't get errors.
The
Archive
constructor callsob_end_clean()
: https://github.com/barracudanetworks/ArchiveStream-php/blob/87540ce2b53257e2fd6505f4b261dc22b82d77c6/src/Archive.php#L94I get why you do this but it causes problems with phpunit tests (because it uses output buffering to know what the tested code outputted):
Would it be possible to add an argument to not disable output buffering?