Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
10 / 10
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
1 / 1
phpbb_functions_validate_with_method_test
100.00% covered (success)
100.00%
10 / 10
100.00% covered (success)
100.00%
3 / 3
3
100.00% covered (success)
100.00%
1 / 1
 setUp
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 test_validate_date
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
1
 validate_with_method
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2/**
3*
4* This file is part of the phpBB Forum Software package.
5*
6* @copyright (c) phpBB Limited <https://www.phpbb.com>
7* @license GNU General Public License, version 2 (GPL-2.0)
8*
9* For full copyright and license information, please see
10* the docs/CREDITS.txt file.
11*
12*/
13
14require_once __DIR__ . '/../../phpBB/includes/functions_user.php';
15require_once __DIR__ . '/validate_data_helper.php';
16
17class phpbb_functions_validate_with_method_test extends phpbb_test_case
18{
19    protected $helper;
20
21    protected function setUp(): void
22    {
23        parent::setUp();
24
25        $this->helper = new phpbb_functions_validate_data_helper($this);
26    }
27
28    public function test_validate_date()
29    {
30        $this->helper->assert_valid_data(array(
31            'method_call' => array(
32                array(),
33                true,
34                array(array(array($this, 'with_method'), false)),
35            ),
36        ));
37    }
38
39    public function validate_with_method($bool, $optional = false)
40    {
41        return ! $bool;
42    }
43}