<?php

namespace AuthStack\Driver\System\tests\units;

use mageekguy\atoum;
use AuthStack\Driver\Model\User as UserModel;
use AuthStack\Driver\System\User as SystemUser;
use AuthStack\Driver\System\Driver as SystemDriver;

class User extends atoum
{
    public function testRetrieveByPrimaryKey()
    {
        $this
            ->given($driver = SystemDriver::initialize('', 1))
            ->then
                ->object($user = $driver->getUserByPrimaryKey(1))->isInstanceOf(SystemUser::class)
                ->boolean($user->removeSecurityKey(15))->isFalse()
                ->integer($user->getAuthstackID())->isEqualTo(1)
                ->array($user->toArray())->isNotEmpty()->hasSize(5)
        ;

        print_r($user->toArray());

    }
}
