<?php

namespace Buckhill\Net\tests\units;

use mageekguy\atoum;
use Buckhill\Net\MAC as MACAddr;
use function Buckhill\Net\getmacaddr;
use function Buckhill\Net\hasMAC;

class MAC extends atoum
{
    public function testCreate()
    {
        $this
            ->given($mac = new MACAddr())
            ->then
                ->object($mac)->isInstanceOf(MACAddr::class)
                ->array($mac->getInterfaces())->isNotEmpty()
                ->array($mac->getMAC())->isNotEmpty()
                ->array(getmacaddr())->isNotEmpty()
            ;
    }

    public function testMAC()
    {
        $this
            ->given($list = ['bad mac', 'again bad', '08:00:27:0f:31:7f', 'another invalid mac'])
            ->boolean(hasMAC($list))->isTrue();
    }
}