Skip to content

Commit

Permalink
add tests for parallax background matching
Browse files Browse the repository at this point in the history
  • Loading branch information
romka-chev committed May 12, 2015
1 parent 60d6534 commit c80bbd3
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tests/unit/swiper/SwiperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,40 @@ public function testPrevButtonOptions()
$this->assertEquals( 'custom-data-prev-button-id', $swiper->prevButtonOptions['data']['id'] );
}

public function testParallaxBackgroundMatching()
{
$swiper = new Swiper( [
'items' => [
'slide 01',
],
'parallaxOptions' => [
'style' => 'color: #ffffff; background:url(http://lorempixel.com/900/600/nightlife/2/);',
'data' => [
'swiper-parallax' => '23%',
'swiper-parallax-duration' => '750',
]
]
] );

$this->assertEquals( 'http://lorempixel.com/900/600/nightlife/2/', $swiper->parallaxOptions['background'] );


$swiper = new Swiper( [
'items' => [
'slide 01',
],
'parallaxOptions' => [
'style' => 'color: #ffffff; background-image:url(http://lorempixel.com/900/600/nightlife/2/);',
'data' => [
'swiper-parallax' => '23%',
'swiper-parallax-duration' => '750',
]
]
] );

$this->assertEquals( 'http://lorempixel.com/900/600/nightlife/2/', $swiper->parallaxOptions['background'] );
}

public function testParallaxOptionsViaShorthands()
{
$swiper = new Swiper( [
Expand Down

0 comments on commit c80bbd3

Please sign in to comment.