Skip to content

[2.1] Resource watcher component #391

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

Closed
wants to merge 36 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
55cc03b
[ResourceWatcher] resource change event created
everzet Mar 25, 2011
9eec6a1
[ResourceWatcher] resource event listener interface described
everzet Mar 25, 2011
2435265
[ResourceWatcher] created basic resource event listener object
everzet Mar 25, 2011
27afac8
[ResourceWatcher] resource state checker interface described
everzet Mar 25, 2011
d1249df
[ResourceWatcher] created recursive iterator resource state checker
everzet Mar 25, 2011
c8bfa18
[ResourceWatcher] resources tracker interface described
everzet Mar 25, 2011
73b3ea0
[ResourceWatcher] recursive iterator resources tracker created
everzet Mar 25, 2011
150bc5a
[ResourceWatcher] resource watcher object created
everzet Mar 25, 2011
f78ff91
[ResourceWatcher] inotify tracker added
everzet Mar 25, 2011
fe664a6
[ResourceWatcher] use best tracker by default
everzet Mar 25, 2011
d40d2e0
[ResourceWatcher] renamed Event::handes to Event::supports to be cons…
everzet Mar 25, 2011
d661a16
[ResourceWatcher] fixed non-empty directory events
everzet Aug 20, 2011
dcb58fa
[Config] updated resources API to be more explicit
everzet Nov 19, 2011
d9b88bd
[Config] moved DirectoryResource childs retrieving to the special get…
everzet Nov 19, 2011
62a116d
[ResourceWatcher] cleaned code little bit
everzet Nov 19, 2011
a714bed
[ResourceWatcher] refactored recursive state checkers into 2 separate…
everzet Nov 19, 2011
7a5587d
[Config] getFilteredChildResources() method added to DirectoryResource
everzet Nov 19, 2011
c6d85a6
[ResourceWatcher] refactored recursive iterator tracker to support ne…
everzet Nov 19, 2011
7429646
[Config] updated DirectoryResource tests
everzet Nov 25, 2011
ebd6fd8
[Config] update FileResourceTest
everzet Nov 25, 2011
0ab201d
[ResourceWatcher] removed InotifyTracker as i have no ability to test…
everzet Nov 25, 2011
816373d
[Config] added new methods and their tests to File and Directory reso…
everzet Nov 29, 2011
bc8e437
[ResourceWatcher] updated ResourceWatcher and TrackerInterface
everzet Nov 29, 2011
40e7f4e
[ResourceWatcher] added time information to events
everzet Nov 29, 2011
6752b30
[ResourceWatcher] updated FileStateChecker to match FileResource API
everzet Nov 29, 2011
e73385b
[ResourceWatcher] refactored DirectoryStateChecker
everzet Nov 29, 2011
554a48d
[ResourceWatcher] refactored RecursiveIteratorTracker
everzet Nov 29, 2011
cd9a2a7
[ResourceWatcher] updated StateCheckerInterface
everzet Nov 29, 2011
51172e2
[ResourceWatcher] return of the InotifyTracker
everzet Nov 29, 2011
f0f9fd9
[ResourceWatcher] removed unneeded code
fabpot Dec 5, 2011
cb8a3d1
[ResourceWatcher] added an exception when inotify is not available
fabpot Dec 5, 2011
879ddff
[Config] made ResourceInterface extends Serializable
fabpot Dec 5, 2011
a62c413
[ResourceWatcher] removed dead code
fabpot Dec 5, 2011
fbb5849
[ResourceWatcher] added the possibility to watch files that do not ex…
fabpot Dec 5, 2011
51b8613
[ResourceWatcher] added exception classes for the component
fabpot Dec 29, 2011
11611e9
-
fabpot Dec 29, 2011
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[Config] update FileResourceTest
  • Loading branch information
everzet committed Nov 25, 2011
commit ebd6fd86aefcb6ae5581d8522eed9505754d3b42
25 changes: 15 additions & 10 deletions tests/Symfony/Tests/Component/Config/Resource/FileResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ protected function setUp()

protected function tearDown()
{
unlink($this->file);
if ($this->file) {
unlink($this->file);
}
}

/**
Expand All @@ -51,21 +53,24 @@ public function testIsFresh()
}

/**
* @covers Symfony\Component\Config\Resource\FileResource::exists
* @covers Symfony\Component\Config\Resource\FileResource::getModificationTime
*/
public function testExists()
public function testGetModificationTime()
{
$this->assertTrue($this->resource->exists(), '->exists() returns true if the resource does exist');

$resource = new FileResource('/____foo/foobar'.rand(1, 999999));
$this->assertFalse($resource->exists(), '->exists() returns false if the resource does not exist');
touch($this->file, $time = time() + 100);
$this->assertSame($time, $this->resource->getModificationTime());
}

/**
* @covers Symfony\Component\Config\Resource\FileResource::getModificationTime
* @covers Symfony\Component\Config\Resource\FileResource::exists
*/
public function testGetModificationTime()
public function testExists()
{
$this->assertSame(filemtime($this->resource->getResource()), $this->resource->getModificationTime());
$this->assertTrue($this->resource->exists(), '->exists() returns true if the resource exists');

unlink($this->file);
$this->file = null;

$this->assertFalse($this->resource->exists(), '->exists() returns false if the resource does not exists');
}
}