- self::$configInstance->setServerAddress(12345);
- }
-
- /**
- * Tests setting a float server address
- */
- public function testConfigSettingFloatServerAddress () {
- // Expect this exception
- $this->expectException(InvalidArgumentException::class);
-
- // Test it
- self::$configInstance->setServerAddress(123.45);
- }
-
- /**
- * Tests setting an array server address
- */
- public function testConfigSettingArrayServerAddress () {
- // Expect this exception
- $this->expectException(InvalidArgumentException::class);
-
- // Test it
- self::$configInstance->setServerAddress(array());
- }
-
- /**
- * Tests setting an object server address
- */
- public function testConfigSettingObjectServerAddress () {
- // Expect this exception
- $this->expectException(InvalidArgumentException::class);
-
- // Test it
- self::$configInstance->setServerAddress($this);
- }
-
- /**
- * Tests setting a resource server address
- */
- public function testConfigSettingResourceServerAddress () {
- // Expect this exception
- $this->expectException(InvalidArgumentException::class);
-
- // Init some resource
- $resource = fopen(__FILE__, 'r');
-
- // Test it
- self::$configInstance->setServerAddress($resource);
- }
-
- /**
- * Tests setting an empty server address
- */
- public function testConfigSettingEmptyServerAddress () {
- // Expect this exception
- $this->expectException(InvalidArgumentException::class);
-
- // Test it
- self::$configInstance->setServerAddress('');
- }
-
- /**
- * Tests setting a valid server address and getting it back
- */
- public function testConfigGettingValidServerAddress () {
- // Test it
- self::$configInstance->setServerAddress('127.0.0.1');
-
- // Get it back
- $serverAddress = self::$configInstance->getServerAddress();
-
- // Should be equal
- $this->assertEquals('127.0.0.1', $serverAddress);