1<?php 2 3/* Copyright 2013-present Facebook, Inc. 4 * Licensed under the Apache License, Version 2.0 */ 5 6class fishyTestCase extends WatchmanTestCase { 7 function needsLiveConnection() { 8 return true; 9 } 10 11 function testFishy() { 12 if (phutil_is_windows()) { 13 $this->assertSkipped("simple ln -s without admin on windows"); 14 } 15 $dir = new WatchmanDirectoryFixture(); 16 $root = $dir->getPath(); 17 mkdir("$root/foo"); 18 touch("$root/foo/a"); 19 $watch = $this->watch($root); 20 21 $base = $this->watchmanCommand('find', $root, '.'); 22 // This is "c:PID:1" because nothing has changed in $root yet 23 $clock = $base['clock']; 24 25 $this->suspendWatchman(); 26 system( 27 "cd $root; ". 28 "mv foo bar; ". 29 "ln -s bar foo" 30 ); 31 $this->resumeWatchman(); 32 33 $this->assertFileListUsingSince($root, $clock, 34 array( 35 'bar', 36 'bar/a', 37 'foo' 38 ) 39 ); 40 41 } 42} 43