assertEquals($binaryString, $attr->getValue()); } public function getValidStatuses() { return [ [123, '1111011'], ['123', '1111011'], ['0b1111011', '1111011'], ['1111011', '1111011'], ['0x7b', '1111011'], ['7b', '1111011'], ]; } /** * @covers Alchemy\Phrasea\Border\Attribute\Status::__construct * @dataProvider getInvalidStatuses * @expectedException \InvalidArgumentException */ public function testInvalidConstruction($status) { new Status(self::$DI['app'], $status); } public function getInvalidStatuses() { return [ ['0b00z2'], ['0x00g2'], ['g2'], ]; } /** * @covers Alchemy\Phrasea\Border\Attribute\Status::getName */ public function testGetName() { $status = new Status(self::$DI['app'], 123); $this->assertEquals(AttributeInterface::NAME_STATUS, $status->getName()); } /** * @covers Alchemy\Phrasea\Border\Attribute\Status::getValue */ public function testGetValue() { $status = new Status(self::$DI['app'], 123); $this->assertEquals('1111011', $status->getValue()); } /** * @covers Alchemy\Phrasea\Border\Attribute\Status::asString */ public function testAsString() { $status = new Status(self::$DI['app'], 123); $this->assertEquals('1111011', $status->asString()); } /** * @covers Alchemy\Phrasea\Border\Attribute\Status::loadFromString */ public function testLoadFromString() { $status = new Status(self::$DI['app'], 12345); $this->assertEquals($status, Status::loadFromString(self::$DI['app'], $status->asString())); } }