<?php

namespace Aviat\Banker\Tests;

use Aviat\Banker\Item;
use Aviat\Banker\ItemCollection;
use Aviat\Banker\Driver\NullDriver;
use Aviat\Banker\Exception\InvalidArgumentException;
use PHPUnit\Framework\TestCase;

class ItemTest extends TestCase {
	
	protected $key = 'foo';
	protected $item;
	protected $driver;
	
	public function setUp()
	{
		$this->driver = new NullDriver();
		$this->item = new Item($this->driver, $this->key);
	}
	
	public function testGetKey()
	{
		$this->assertEquals($this->key, $this->item->getKey());
	}
	
	public function testGet()
	{
		// No value set yet
		$this->assertNull($this->item->get());
		
		// Set a value
		$this->item->set('bar')
			->save();
			
		$this->assertEquals('bar', $this->item->get());
	}
}