'fire', 'b' => 'use'] as $button => $action) { $key = (string)$project['touch'][$button]; self::assertMatchesRegularExpression('/^([A-Z]|Space|Return|Escape|Tab)$/', $key, "button $button"); self::assertContains($key, $actions[$action], "button $button fires '$action'"); } } public function testATouchOfTheStickIsNotAShot(): void { // on phones a touch is also a mouse click: the mouse must not be bound to "fire" $actions = Yaml::parseFile(dirname(__DIR__) . '/config/input.yaml')['actions']; foreach ($actions['fire'] as $binding) { self::assertStringStartsNotWith('mouse:', (string)$binding); self::assertStringStartsNotWith('touch:', (string)$binding); } } public function testScale2xDoublesAPictureAndSmoothsItsStaircases(): void { // a diagonal staircase of 'a' over 'b' $px = "abb" . "aab" . "aaa"; $big = HdRenderer::scale2x($px, 3, 3, false); self::assertSame(36, strlen($big)); self::assertSame('a', $big[0]); self::assertSame('b', $big[5]); // the corner of the staircase gets the colour of its neighbours self::assertSame('a', $big[1 * 6 + 2]); } }