<commit_before><?php

namespace WyriHaximus\React\Tests\Cake\Orm;

use Phake;
use React\EventLoop\LoopInterface;
use WyriHaximus\React\Cake\Orm\AsyncTable;
use WyriHaximus\React\Cake\Orm\AsyncTableRegistry;
use WyriHaximus\React\Cake\Orm\Pool;
use WyriHaximus\React\ChildProcess\Pool\PoolInterface;
use WyriHaximus\React\Tests\Cake\Orm\Annotations\TestTables\AsyncClassAsyncMethodTable;

class PoolTest extends TestCase
{
    public function testGetInstance()
    {
        $loop = Phake::mock(LoopInterface::class);
        $this->assertInstanceOf(Pool::class, Pool::getInstance($loop));
    }

    public function testReset()
    {
        $loop = Phake::mock(LoopInterface::class);
        $first = spl_object_hash(Pool::getInstance($loop));
        Pool::reset();
        $second = spl_object_hash(Pool::getInstance($loop));
        $this->assertNotSame($first, $second);
    }

    public function testGetLoop()
    {
        $loop = Phake::mock(LoopInterface::class);
        $this->assertSame($loop, Pool::getInstance($loop)->getLoop());
    }

    public function testGetPool()
    {
        $loop = Phake::mock(LoopInterface::class);
        $this->assertInstanceOf(PoolInterface::class, Pool::getInstance($loop)->getPool());
    }
}<commit_msg>Removed unused use statements<commit_after><?php

namespace WyriHaximus\React\Tests\Cake\Orm;

use Phake;
use React\EventLoop\LoopInterface;
use WyriHaximus\React\Cake\Orm\Pool;
use WyriHaximus\React\ChildProcess\Pool\PoolInterface;

class PoolTest extends TestCase
{
    public function testGetInstance()
    {
        $loop = Phake::mock(LoopInterface::class);
        $this->assertInstanceOf(Pool::class, Pool::getInstance($loop));
    }

    public function testReset()
    {
        $loop = Phake::mock(LoopInterface::class);
        $first = spl_object_hash(Pool::getInstance($loop));
        Pool::reset();
        $second = spl_object_hash(Pool::getInstance($loop));
        $this->assertNotSame($first, $second);
    }

    public function testGetLoop()
    {
        $loop = Phake::mock(LoopInterface::class);
        $this->assertSame($loop, Pool::getInstance($loop)->getLoop());
    }

    public function testGetPool()
    {
        $loop = Phake::mock(LoopInterface::class);
        $this->assertInstanceOf(PoolInterface::class, Pool::getInstance($loop)->getPool());
    }
}
{'fraction_non_alphanumeric': 0.14517506404782238, 'fraction_numerical': 0.0, 'mean_word_length': 3.9326315789473685, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6467721', 'n_tokens_mistral': 733, 'n_tokens_neox': 727, 'n_words': 105}