/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. * * @return void */ protected function setUp() { $this->instance = new ColorProcessor(); $this->winOs = TestEnvironment::isWindows(); if ($this->winOs) { $this->instance->setNoColors(true); } }
/** * Test prompter ask. * * @return void * * @since 2.0 */ public function testAsk() { if (TestEnvironment::isWindows()) { $this->markTestSkipped('This test is not supported on Windows'); } $this->markTestSkipped('This test no available now.'); return; $this->setStream("1234qwer\n"); $in = $this->instance->ask('Enter password: '******'1234qwer', $in); }
/** * Method to test create(). * * @return void * * @covers Windwalker\Filesystem\Folder::create */ public function testCreate() { Folder::create(static::$dest . '/flower'); $this->assertTrue(is_dir(static::$dest . '/flower')); Folder::create(static::$dest . '/foo/bar'); $this->assertTrue(is_dir(static::$dest . '/foo/bar')); Folder::create(static::$dest . '/yoo', 0775); if (TestEnvironment::isWindows()) { $this->assertEquals(777, Path::getPermissions(static::$dest . '/yoo')); } else { $this->assertEquals(775, Path::getPermissions(static::$dest . '/yoo')); } }