Skip to content

Commit

Permalink
Item14152: Merge commit 'e0c160aa371dceb6ccc6f76f68408b8ae30dab23' in…
Browse files Browse the repository at this point in the history
…to Item14152

* commit 'e0c160aa371dceb6ccc6f76f68408b8ae30dab23':
  Item13897: Few code adaptations.
  Item14232: Fixes to previous commit.
  Item14232: Implementation of feature sets proposl
  • Loading branch information
vrurg committed Nov 28, 2016
2 parents cfb0a44 + e0c160a commit dd9b500
Show file tree
Hide file tree
Showing 13 changed files with 1,562 additions and 95 deletions.
8 changes: 4 additions & 4 deletions EditRowPlugin/test/unit/EditRowPlugin/HTML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
package HTML;
use v5.14;

use Moo;
use Foswiki::Class;
extends qw(FoswikiFnTestCase);

around loadExtraConfig => sub {
my $orig = shift;
my $this = shift;

$orig->( $this, @_ );
$Foswiki::cfg{Plugins}{EditRowPlugin}{Enabled} = 1;
$Foswiki::cfg{Plugins}{EditRowPlugin}{Macro} = 'EDITTABLE';
$Foswiki::cfg{Plugins}{EditTablePlugin}{Enabled} = 0;
$this->app->cfg->data->{Plugins}{EditRowPlugin}{Enabled} = 1;
$this->app->cfg->data->{Plugins}{EditRowPlugin}{Macro} = 'EDITTABLE';
$this->app->cfg->data->{Plugins}{EditTablePlugin}{Enabled} = 0;
};

around createNewFoswikiApp => sub {
Expand Down
56 changes: 27 additions & 29 deletions EmptyJQueryPlugin/lib/Foswiki/Plugins/EmptyJQueryPlugin/YOUR.pm
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# See bottom of file for license and copyright information

package Foswiki::Plugins::EmptyJQueryPlugin::YOUR;
use strict;
use warnings;

use Foswiki::Plugins::JQueryPlugin::Plugin;
our @ISA = qw( Foswiki::Plugins::JQueryPlugin::Plugin );
use Foswiki::Plugins::EmptyJQueryPlugin (); # for version information

use Foswiki::Plugins::EmptyJQueryPlugin (); # for version information
use Foswiki::Class;
extends qw( Foswiki::Plugins::JQueryPlugin::Plugin );

=begin TML
Expand All @@ -25,31 +23,31 @@ Constructor
=cut

sub new {
my $class = shift;
my $session = shift || $Foswiki::Plugins::SESSION;

my $this = bless(
$class->SUPER::new(
$session,
name => 'your',
# Use the version number from the Foswiki plugin; this keeps the
# version number in lock-step between the JQuery plugin and
# the Foswiki plugin.
version => $Foswiki::Plugins::EmptyJQueryPlugin::VERSION,
author => $Foswiki::Plugins::EmptyJQueryPlugin::AUTHOR,
homepage => 'JQuery module\'s URL',
documentation => "$Foswiki::cfg{SystemWebName}.JQueryYour",
puburl => '%PUBURLPATH%/%SYSTEMWEB%/EmptyJQueryPlugin/your',
javascript => ['jquery.your.js']

# ,css => ['jquery.your.css']
),
$class
around BUILDARGS => sub {
my $orig = shift;
my $class = shift;
my %params = @_;

my $app = $params{app};

return $orig->(
$class,
@_,
name => 'your',

# Use the version number from the Foswiki plugin; this keeps the
# version number in lock-step between the JQuery plugin and
# the Foswiki plugin.
version => $Foswiki::Plugins::EmptyJQueryPlugin::VERSION,
author => $Foswiki::Plugins::EmptyJQueryPlugin::AUTHOR,
homepage => 'JQuery module\'s URL',
documentation => $app->cfg->data->{SystemWebName} . ".JQueryYour",
puburl => '%PUBURLPATH%/%SYSTEMWEB%/EmptyJQueryPlugin/your',
javascript => ['jquery.your.js']

# ,css => ['jquery.your.css']
);

return $this;
}
};

1;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# See bottom of file for license and copyright information
package EmptyJQueryPluginSuite;

use strict;
use warnings;

use Unit::TestSuite;
our @ISA = 'Unit::TestSuite';
use Foswiki::Class;
extends 'Unit::TestSuite';

sub name { 'EmptyJQueryPluginSuite' }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,27 @@
# See bottom of file for license and copyright information
use strict;
use warnings;

package EmptyJQueryPluginTests;

use FoswikiTestCase;
our @ISA = qw( FoswikiTestCase );

use strict;
use warnings;
use Foswiki;
use CGI;

my $foswiki;

sub new {
my $self = shift()->SUPER::new(@_);
return $self;
}
use Foswiki::Class;
extends qw( FoswikiTestCase );

# Set up the test fixture
sub set_up {
around set_up => sub {
my $orig = shift;
my $this = shift;

$this->SUPER::set_up();
$orig->( $this, @_ );
};

$Foswiki::Plugins::SESSION = $foswiki;
}

sub tear_down {
around tear_down => sub {
my $orig = shift;
my $this = shift;
$this->SUPER::tear_down();
}

$orig->( $this, @_ );
};

sub test_self {
my $this = shift;
Expand Down
7 changes: 2 additions & 5 deletions EmptyPlugin/test/unit/EmptyPlugin/EmptyPluginSuite.pm
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# See bottom of file for license and copyright information
package EmptyPluginSuite;

use strict;
use warnings;

use Unit::TestSuite;
our @ISA = 'Unit::TestSuite';
use Foswiki::Class;
extends 'Unit::TestSuite';

sub name { 'EmptyPluginSuite' }

Expand Down
33 changes: 11 additions & 22 deletions EmptyPlugin/test/unit/EmptyPlugin/EmptyPluginTests.pm
Original file line number Diff line number Diff line change
@@ -1,37 +1,26 @@
# See bottom of file for license and copyright information
use strict;
use warnings;

package EmptyPluginTests;

use FoswikiTestCase;
our @ISA = qw( FoswikiTestCase );

use strict;
use warnings;
use Foswiki;
use CGI;

my $foswiki;

sub new {
my $self = shift()->SUPER::new(@_);
return $self;
}
use Foswiki::Class;
extends qw( FoswikiTestCase );

# Set up the test fixture
sub set_up {
around set_up => sub {
my $orig = shift;
my $this = shift;

$this->SUPER::set_up();
$orig->( $this, @_ );
};

$Foswiki::Plugins::SESSION = $foswiki;
}

sub tear_down {
around tear_down => sub {
my $orig = shift;
my $this = shift;
$this->SUPER::tear_down();
}

$orig->( $this, @_ );
};

sub test_self {
my $this = shift;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ test/unit/ExceptionTests.pm 0644
test/unit/ExtensionsTests.pm 0644
test/unit/ExpandMacrosTests.pm 0644
test/unit/ExtensionInstallerTests.pm 0644
test/unit/FeatureSetTests.pm 0644
test/unit/Fn_ENCODE.pm 0644
test/unit/Fn_FORMAT.pm 0644
test/unit/Fn_FORMFIELD.pm 0644
Expand Down
3 changes: 1 addition & 2 deletions UnitTestContrib/test/unit/EmptyTests.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ use v5.14;
use Foswiki;
use Try::Tiny;

use Moo;
use namespace::clean;
use Foswiki::Class;
extends qw( FoswikiTestCase );

around set_up => sub {
Expand Down
Loading

0 comments on commit dd9b500

Please sign in to comment.