Skip to content

Commit

Permalink
https:// でテストするよう修正
Browse files Browse the repository at this point in the history
  • Loading branch information
nanasess committed Dec 23, 2019
1 parent 3ed4376 commit 40ed775
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ jobs:
run: |
data/vendor/bin/phpunit --exclude-group classloader
data/vendor/bin/phpunit --group classloader
sed 's|http://|https://|g' -i.bak data/config/config.php
data/vendor/bin/phpunit tests/class/SC_SessionFactoryTest.php
- name: Run chromedriver
run: |
Expand Down Expand Up @@ -183,6 +185,8 @@ jobs:
run: |
data/vendor/bin/phpunit --exclude-group classloader
data/vendor/bin/phpunit --group classloader
sed 's|http://|https://|g' -i.bak data/config/config.php
data/vendor/bin/phpunit tests/class/SC_SessionFactoryTest.php
install-to-linux:
name: Install to Linux
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ script:
- if [ ! $COVERAGE ] ; then php data/vendor/bin/phpunit -c phpunit.xml.dist --group classloader ; fi
- if [ $COVERAGE ] ; then phpdbg -qrr data/vendor/bin/phpunit -c phpunit.xml.dist --exclude-group classloader ; fi
- if [ ! $COVERAGE ] ; then php data/vendor/bin/codecept run --env chrome --skip-group installer --steps ; fi
- sed -e 's|http://|https://|g' -i.bak data/config/config.php
- if [ ! $COVERAGE ] ; then php data/vendor/bin/phpunit -c phpunit.xml.dist tests/class/SC_SessionFactoryTest.php ; fi

after_script:
- if [ $COVERAGE ] ; then php data/vendor/bin/coveralls -v ; fi
Expand Down
22 changes: 22 additions & 0 deletions tests/class/SC_SessionFactoryTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

class SC_SessionFactoryTest extends Common_TestCase
{
public function testGetInstance()
{
$sessionFactory = SC_SessionFactory_Ex::getInstance();
$sessionFactory->initSession();

$this->assertInstanceOf('SC_SessionFactory_UseCookie', $sessionFactory);
$this->assertTrue($sessionFactory->useCookie());

$refClass = new ReflectionClass($sessionFactory);
$refMethod = $refClass->getMethod('getSecureOption');
$refMethod->setAccessible(true);
if (strpos(HTTP_URL, 'https') !== false) {
$this->assertTrue($refMethod->invoke($sessionFactory));
} else {
$this->markTestIncomplete();
}
}
}

0 comments on commit 40ed775

Please sign in to comment.