Skip to content
Browse files

Added string-upcase, string-downcase.

  • Loading branch information...
1 parent 9817491 commit 5585f1d1f4ba332957ecdb488737ced790ca0d43 @dahlia dahlia committed Nov 28, 2009
Showing with 9 additions and 1 deletion.
  1. +3 −1 Lisphp/Environment.php
  2. +6 −0 Lisphp/Test/EnvironmentTest.php
View
4 Lisphp/Environment.php
@@ -46,7 +46,9 @@ static function sandbox() {
$scope['/'] = new Lisphp_Runtime_Arithmetic_Division;
$scope['%'] = $scope['mod'] =new Lisphp_Runtime_Arithmetic_Modulus;
$scope['.'] = $scope['concat'] =new Lisphp_Runtime_String_Concat;
- $scope['string-join'] =new Lisphp_Runtime_String_StringJoin;
+ $scope['string-join'] = new Lisphp_Runtime_String_StringJoin;
+ $scope['string-upcase'] = new Lisphp_Runtime_PHPFunction('strtoupper');
+ $scope['string-downcase']= new Lisphp_Runtime_PHPFunction('strtolower');
$scope['not'] = new Lisphp_Runtime_Logical_Not;
$scope['and'] = new Lisphp_Runtime_Logical_And;
$scope['or'] = new Lisphp_Runtime_Logical_Or;
View
6 Lisphp/Test/EnvironmentTest.php
@@ -70,6 +70,12 @@ function testSandbox($scope = null) {
$this->assertType('Lisphp_Runtime_String_Concat', $scope['concat']);
$this->assertType('Lisphp_Runtime_String_StringJoin',
$scope['string-join']);
+ $this->assertType('Lisphp_Runtime_PHPFunction',
+ $scope['string-upcase']);
+ $this->assertEquals('strtoupper', $scope['string-upcase']->callback);
+ $this->assertType('Lisphp_Runtime_PHPFunction',
+ $scope['string-downcase']);
+ $this->assertEquals('strtolower', $scope['string-downcase']->callback);
$this->assertType('Lisphp_Runtime_Logical_Not', $scope['not']);
$this->assertType('Lisphp_Runtime_Logical_And', $scope['and']);
$this->assertType('Lisphp_Runtime_Logical_Or', $scope['or']);

0 comments on commit 5585f1d

Please sign in to comment.
Something went wrong with that request. Please try again.