<?php

$I = new FunctionalTester($scenario);
$rabman = new \Rabman\ResourceFactory(\Codeception\Util\Fixtures::get('rabman-opt'));
$items = $rabman->extensions();
$count = count($items);
$I->assertTrue($count > 0);
$expected = ['javascript' => 'dispatcher.js'];
$I->assertEquals($expected, $items[0]);
<?php

$I = new FunctionalTester($scenario);
$rabman = new \Rabman\ResourceFactory(\Codeception\Util\Fixtures::get('rabman-opt'));
$items = $rabman->nodes()->columns(['exchange_types.name']);
$count = count($items);
$I->assertTrue($count > 0);
$expected = [['name' => 'direct'], ['name' => 'headers'], ['name' => 'topic'], ['name' => 'fanout']];
$I->assertEquals($expected, $items[0]['exchange_types']);
<?php

$I = new FunctionalTester($scenario);
$rabman = new \Rabman\ResourceFactory(\Codeception\Util\Fixtures::get('rabman-opt'));
$items = $rabman->queues();
$count = count($items);
$I->assertTrue($count > 0);
/*$queues = $source->queues('queue.billing.test')->vhost()->get([
    "count"    => 5,
    "requeue"  => true,
    "encoding" => "auto",
]);*/
<?php

$I = new FunctionalTester($scenario);
$rabman = new \Rabman\ResourceFactory(\Codeception\Util\Fixtures::get('rabman-opt'));
$rabman->cluster()->create(['name' => 'rabbit@my-rabbit']);
$items = $rabman->cluster();
$count = count($items);
$I->assertTrue($count > 0);
$I->assertEquals('rabbit@my-rabbit', $items[0]['name']);
$rabman->cluster()->create(['name' => 'rabbit@not-my-rabbit']);
$items = $rabman->cluster();
$count = count($items);
$I->assertTrue($count > 0);
$I->assertEquals('rabbit@not-my-rabbit', $items[0]['name']);
<?php

$I = new FunctionalTester($scenario);
$rabman = new \Rabman\ResourceFactory(\Codeception\Util\Fixtures::get('rabman-opt'));
$items = $rabman->exchanges()->columns(['name'])->sort('name', true);
$count = count($items);
$I->assertTrue($count > 0);
$rabman->exchanges('second.ex.1')->vhost('second_virtual')->create(['type' => 'topic']);
$rabman->exchanges('second.ex.1')->vhost('second_virtual')->delete();
<?php

$I = new FunctionalTester($scenario);
$rabman = new \Rabman\ResourceFactory(\Codeception\Util\Fixtures::get('rabman-opt'));
$items = $rabman->overview()->columns(['management_version']);
$count = count($items);
$I->assertTrue($count > 0);
$I->assertEquals('3.6.1', $items[0]['management_version']);
<?php

$fixture = (require 'fixtures/definition.php');
$I = new FunctionalTester($scenario);
$rabman = new \Rabman\ResourceFactory(\Codeception\Util\Fixtures::get('rabman-opt'));
$items = $rabman->definitions();
$count = count($items);
$I->assertTrue($count > 0);
$rabman->definitions()->vhost()->create(json_decode($fixture, true));
$items = $rabman->exchanges('second.exchange.5')->columns(['name']);
count($items);
$I->assertTrue($count > 0);
$I->assertEquals('second.exchange.5', $items[0]['name']);