-
-
Notifications
You must be signed in to change notification settings - Fork 74
unit testing improvement #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
cc36d51
808ec2b
6de4ba4
e4117d2
4c84154
48550d5
ce5854e
2c00546
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
language: php | ||
|
||
sudo: false | ||
|
||
cache: | ||
directories: | ||
- $HOME/.composer/cache | ||
|
@@ -22,8 +20,7 @@ matrix: | |
fast_finish: true | ||
|
||
before_script: | ||
- rm -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini | ||
- composer install --no-interaction --no-progress --prefer-dist | ||
|
||
script: | ||
- vendor/bin/phpunit | ||
- vendor/bin/phpunit -d error_reporting=16384 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Guess it is related to hhvm? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. Please refer this issue. Thanks. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of composer/semver. | ||
* | ||
* (c) Composer <https://github.com/composer> | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Composer\Semver\Constraint; | ||
|
||
class AbstractConstraintInstance extends AbstractConstraint | ||
{ | ||
public function __toString() | ||
{ | ||
return $this->prettyString; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of composer/semver. | ||
* | ||
* (c) Composer <https://github.com/composer> | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Composer\Semver\Constraint; | ||
|
||
class AbstractConstraintTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @expectedException PHPUnit_Framework_Error_Deprecated | ||
*/ | ||
public function testAbstractConstraintWithDeprecated() | ||
{ | ||
$expectedString = 'pretty string'; | ||
$constraint = new AbstractConstraintInstance(); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of composer/semver. | ||
* | ||
* (c) Composer <https://github.com/composer> | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Composer\Semver\Constraint; | ||
|
||
class EmptyConstraintTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
protected $versionProvide; | ||
protected $emptyConstraint; | ||
|
||
protected function setUp() | ||
{ | ||
$this->versionProvide = new Constraint('==', '1.1'); | ||
$this->emptyConstraint = new EmptyConstraint(); | ||
} | ||
|
||
public function testMatches() | ||
{ | ||
$result = $this->emptyConstraint->matches($this->versionProvide); | ||
|
||
$this->assertTrue($result); | ||
} | ||
|
||
public function testGetPrettyString() | ||
{ | ||
$expectedString = 'pretty-string'; | ||
$this->emptyConstraint->setPrettyString($expectedString); | ||
$result = $this->emptyConstraint->getPrettyString(); | ||
|
||
$this->assertSame($expectedString, $result); | ||
|
||
$expectedString = '[]'; | ||
$this->emptyConstraint->setPrettyString(null); | ||
$result = $this->emptyConstraint->getPrettyString(); | ||
|
||
$this->assertSame($expectedString, $result); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be reverted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @stof, the original configuration is false.
Please see this PR. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the default value for
sudo
is not always false actually. It depends on repositories.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I have been confused this for a long time.
Would you please provide some references about this?
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's false for this repo by default though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See https://blog.travis-ci.com/2016-04-07-migration-update and https://docs.travis-ci.com/user/ci-environment/#Virtualization-environments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alcohol but it makes it harder to copy-paste the config elsewhere (composer has some repository where it is not the default)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi all, I think the proper way is adding the
sudo: false
for each time so that it can always make sure that it's running on the non-root environment.What do you think?
Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I prefer being explicit too, as it does not require knowing at which date the repo started using Travis (this info is not available anywhere except in the Travis database AFAIK, and we cannot access it)