FactoryTest.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /*
  3. * This file is part of Composer.
  4. *
  5. * (c) Nils Adermann <naderman@naderman.de>
  6. * Jordi Boggiano <j.boggiano@seld.be>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace Composer\Test;
  12. use PHPUnit\Framework\TestCase;
  13. use Composer\Factory;
  14. class FactoryTest extends TestCase
  15. {
  16. /**
  17. * @group TLS
  18. */
  19. public function testDefaultValuesAreAsExpected()
  20. {
  21. $ioMock = $this->getMockBuilder('Composer\IO\IOInterface')->getMock();
  22. $ioMock->expects($this->once())
  23. ->method("writeError")
  24. ->with($this->equalTo('<warning>You are running Composer with SSL/TLS protection disabled.</warning>'));
  25. $config = $this
  26. ->getMockBuilder('Composer\Config')
  27. ->getMock();
  28. $config->method('get')
  29. ->with($this->equalTo('disable-tls'))
  30. ->will($this->returnValue(true));
  31. Factory::createRemoteFilesystem($ioMock, $config);
  32. }
  33. }