<?php
namespace ccxt;

// ----------------------------------------------------------------------------

// PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
// https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code

// -----------------------------------------------------------------------------
include_once PATH_TO_CCXT . '/test/exchange/base/test_shared_methods.php';

function test_ohlcv($exchange, $skipped_properties, $method, $entry, $symbol, $now) {
    $format = [1638230400000, $exchange->parse_number('0.123'), $exchange->parse_number('0.125'), $exchange->parse_number('0.121'), $exchange->parse_number('0.122'), $exchange->parse_number('123.456')];
    $empty_not_allowed_for = [0, 1, 2, 3, 4, 5];
    assert_structure($exchange, $skipped_properties, $method, $entry, $format, $empty_not_allowed_for);
    assert_timestamp_and_datetime($exchange, $skipped_properties, $method, $entry, $now, 0);
    $log_text = log_template($exchange, $method, $entry);
    //
    assert(count($entry) >= 6, 'ohlcv array length should be >= 6;' . $log_text);
    if (!(is_array($skipped_properties) && array_key_exists('roundTimestamp', $skipped_properties))) {
        assert_round_minute_timestamp($exchange, $skipped_properties, $method, $entry, 0);
    }
    $high = $exchange->safe_string($entry, 2);
    $low = $exchange->safe_string($entry, 3);
    assert_less_or_equal($exchange, $skipped_properties, $method, $entry, '1', $high);
    assert_greater_or_equal($exchange, $skipped_properties, $method, $entry, '1', $low);
    assert_less_or_equal($exchange, $skipped_properties, $method, $entry, '4', $high);
    assert_greater_or_equal($exchange, $skipped_properties, $method, $entry, '4', $low);
    assert(($symbol === null) || (is_string($symbol)), 'symbol ' . $symbol . ' is incorrect' . $log_text); // todo: check with standard symbol check
}
